parent
dd17065129
commit
67875e2afa
|
@ -4,6 +4,7 @@ import {
|
||||||
get as iget,
|
get as iget,
|
||||||
set as iset,
|
set as iset,
|
||||||
del as idel,
|
del as idel,
|
||||||
|
createStore,
|
||||||
} from 'idb-keyval';
|
} from 'idb-keyval';
|
||||||
|
|
||||||
const fallbackName = (key: string) => `idbfallback::${key}`;
|
const fallbackName = (key: string) => `idbfallback::${key}`;
|
||||||
|
@ -12,9 +13,9 @@ let idbAvailable = typeof window !== 'undefined' ? !!window.indexedDB : true;
|
||||||
|
|
||||||
if (idbAvailable) {
|
if (idbAvailable) {
|
||||||
try {
|
try {
|
||||||
await iset('idb-test', 'test');
|
await createStore('keyval-store', 'keyval');
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error('idb error', e);
|
console.error('idb open error', e);
|
||||||
idbAvailable = false;
|
idbAvailable = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue