forked from FoundKeyGang/FoundKey
parent
b875cc9949
commit
597c9761cb
1 changed files with 2 additions and 3 deletions
|
@ -4,7 +4,6 @@ import {
|
|||
get as iget,
|
||||
set as iset,
|
||||
del as idel,
|
||||
createStore,
|
||||
} from 'idb-keyval';
|
||||
|
||||
const fallbackName = (key: string) => `idbfallback::${key}`;
|
||||
|
@ -13,9 +12,9 @@ let idbAvailable = typeof window !== 'undefined' ? !!window.indexedDB : true;
|
|||
|
||||
if (idbAvailable) {
|
||||
try {
|
||||
await createStore('keyval-store', 'keyval');
|
||||
await iset('idb-test', 'test');
|
||||
} catch (e) {
|
||||
console.error('idb open error', e);
|
||||
console.error('idb error', e);
|
||||
idbAvailable = false;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue