|
@ -16,6 +16,7 @@ import { AuthContext } from "./app/auth/context"; |
|
|
import authStorage from "./app/auth/storage"; |
|
|
import authStorage from "./app/auth/storage"; |
|
|
import MapDataProvider from "./app/context/MapDataContext"; |
|
|
import MapDataProvider from "./app/context/MapDataContext"; |
|
|
import {getLocation} from "./app/hooks/useLocation"; |
|
|
import {getLocation} from "./app/hooks/useLocation"; |
|
|
|
|
|
import { useFiltering } from "./app/hooks/useFiltering"; |
|
|
|
|
|
|
|
|
export default function App() { |
|
|
export default function App() { |
|
|
const [user, setUser] = useState(); |
|
|
const [user, setUser] = useState(); |
|
@ -23,8 +24,7 @@ export default function App() { |
|
|
|
|
|
|
|
|
const restoreUser = async () => { |
|
|
const restoreUser = async () => { |
|
|
const user = await authStorage.getUser(); |
|
|
const user = await authStorage.getUser(); |
|
|
global.location ={"lat":-10.0173780726763, |
|
|
|
|
|
"long": -67.8170775249999} // await getLocation();
|
|
|
|
|
|
|
|
|
global.location = await getLocation(); |
|
|
if (user) setUser(user); |
|
|
if (user) setUser(user); |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
@ -35,6 +35,7 @@ export default function App() { |
|
|
|
|
|
|
|
|
global.userDataBase = openDatabase(); |
|
|
global.userDataBase = openDatabase(); |
|
|
initDatabase(global.userDataBase); |
|
|
initDatabase(global.userDataBase); |
|
|
|
|
|
global.formsSockets = useFiltering(global.location); |
|
|
|
|
|
|
|
|
return ( |
|
|
return ( |
|
|
<AuthContext.Provider |
|
|
<AuthContext.Provider |
|
|