mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-23 23:19:40 +01:00
feat: improve account recovery
This commit is contained in:
@@ -4,7 +4,7 @@ import { initializeDatabase } from "../common/db";
|
||||
const memory = {
|
||||
isAppLoaded: false,
|
||||
};
|
||||
export default function useDatabase() {
|
||||
export default function useDatabase(persistence) {
|
||||
const [isAppLoaded, setIsAppLoaded] = useState(memory.isAppLoaded);
|
||||
|
||||
useEffect(() => {
|
||||
@@ -12,11 +12,11 @@ export default function useDatabase() {
|
||||
|
||||
(async () => {
|
||||
await import("../app.css");
|
||||
await initializeDatabase();
|
||||
await initializeDatabase(persistence);
|
||||
setIsAppLoaded(true);
|
||||
memory.isAppLoaded = true;
|
||||
})();
|
||||
}, []);
|
||||
}, [persistence]);
|
||||
|
||||
return [isAppLoaded];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user