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);
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 (