Using CordovaSQLiteDriver whenever possible.

This commit is contained in:
Eric van der Vlist 2022-09-23 23:39:53 +02:00
parent d0bac1c509
commit 548d4a43cb
1 changed files with 16 additions and 14 deletions

View File

@ -13,21 +13,23 @@ const DbContextProvider: react.FC<{
const [ready, setReady] = useState(false); const [ready, setReady] = useState(false);
useEffect(() => { useEffect(() => {
const config = { localforage.defineDriver(CordovaSQLiteDriver).then(() => {
name: 'dyomedea', const config = {
driver: [ name: 'dyomedea',
CordovaSQLiteDriver._driver, driver: [
localforage.INDEXEDDB, CordovaSQLiteDriver._driver,
localforage.WEBSQL, localforage.INDEXEDDB,
localforage.LOCALSTORAGE, localforage.WEBSQL,
], localforage.LOCALSTORAGE,
}; ],
const newStore = localforage.createInstance({ };
storeName: 'tracks', const newStore = localforage.createInstance({
...config, storeName: 'tracks',
...config,
});
setStore(newStore);
setReady(true);
}); });
setStore(newStore);
setReady(true);
}, []); }, []);
return ( return (