update storage provider
This commit is contained in:
@@ -20,7 +20,7 @@ const StorageContext = createContext<StorageContext>({
|
|||||||
db: undefined,
|
db: undefined,
|
||||||
});
|
});
|
||||||
|
|
||||||
const StorageProvider = ({ children }: PropsWithChildren<object>) => {
|
const StorageInstance = () => {
|
||||||
const [db, setDB] = useState<LumeStorage>(undefined);
|
const [db, setDB] = useState<LumeStorage>(undefined);
|
||||||
const [isNewVersion, setIsNewVersion] = useState(false);
|
const [isNewVersion, setIsNewVersion] = useState(false);
|
||||||
|
|
||||||
@@ -75,6 +75,12 @@ const StorageProvider = ({ children }: PropsWithChildren<object>) => {
|
|||||||
if (!db) initLumeStorage();
|
if (!db) initLumeStorage();
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
return { db, isNewVersion };
|
||||||
|
};
|
||||||
|
|
||||||
|
const StorageProvider = ({ children }: PropsWithChildren<object>) => {
|
||||||
|
const { db, isNewVersion } = StorageInstance();
|
||||||
|
|
||||||
if (!db)
|
if (!db)
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
|
|||||||
Reference in New Issue
Block a user