diff --git a/src/db/db-context-provider.tsx b/src/db/db-context-provider.tsx index 70bf358..539b98d 100644 --- a/src/db/db-context-provider.tsx +++ b/src/db/db-context-provider.tsx @@ -13,21 +13,23 @@ const DbContextProvider: react.FC<{ const [ready, setReady] = useState(false); useEffect(() => { - const config = { - name: 'dyomedea', - driver: [ - CordovaSQLiteDriver._driver, - localforage.INDEXEDDB, - localforage.WEBSQL, - localforage.LOCALSTORAGE, - ], - }; - const newStore = localforage.createInstance({ - storeName: 'tracks', - ...config, + localforage.defineDriver(CordovaSQLiteDriver).then(() => { + const config = { + name: 'dyomedea', + driver: [ + CordovaSQLiteDriver._driver, + localforage.INDEXEDDB, + localforage.WEBSQL, + localforage.LOCALSTORAGE, + ], + }; + const newStore = localforage.createInstance({ + storeName: 'tracks', + ...config, + }); + setStore(newStore); + setReady(true); }); - setStore(newStore); - setReady(true); }, []); return (