mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-12-23 15:33:08 +02:00
parent
d195406fdc
commit
ebedb81e3f
1 changed files with 7 additions and 6 deletions
|
@ -8,14 +8,15 @@ import {
|
|||
|
||||
const fallbackName = (key: string) => `idbfallback::${key}`;
|
||||
|
||||
let idbAvailable = typeof window !== 'undefined' ? !!window.indexedDB : true;
|
||||
let idbAvailable = typeof window !== 'undefined' ? !!(window.indexedDB && window.indexedDB.open) : true;
|
||||
|
||||
if (idbAvailable) {
|
||||
iset('idb-test', 'test').catch(err => {
|
||||
console.error('idb error', err);
|
||||
console.error('indexedDB is unavailable. It will use localStorage.');
|
||||
idbAvailable = false;
|
||||
});
|
||||
await iset('idb-test', 'test')
|
||||
.catch(err => {
|
||||
console.error('idb error', err);
|
||||
console.error('indexedDB is unavailable. It will use localStorage.');
|
||||
idbAvailable = false;
|
||||
});
|
||||
} else {
|
||||
console.error('indexedDB is unavailable. It will use localStorage.');
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue