Skip to content
Snippets Groups Projects
Commit ebedb81e authored by tamaina's avatar tamaina
Browse files

update idb-proxy.ts

Maybe fixed #9769
parent d195406f
No related branches found
No related tags found
No related merge requests found
......@@ -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.');
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment