remove debugging code
This commit is contained in:
parent
8e14463215
commit
a299737a29
|
@ -4,16 +4,12 @@ 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}`;
|
||||||
|
|
||||||
let idbAvailable = typeof window !== 'undefined' ? !!window.indexedDB : true;
|
let idbAvailable = typeof window !== 'undefined' ? !!window.indexedDB : true;
|
||||||
|
|
||||||
console.log(window.indexedDB);
|
|
||||||
console.log(idbAvailable);
|
|
||||||
|
|
||||||
if (idbAvailable) {
|
if (idbAvailable) {
|
||||||
try {
|
try {
|
||||||
const request = indexedDB.open('keyval-store');
|
const request = indexedDB.open('keyval-store');
|
||||||
|
@ -23,12 +19,11 @@ if (idbAvailable) {
|
||||||
request.onsuccess = (e) => res(e);
|
request.onsuccess = (e) => res(e);
|
||||||
});
|
});
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log('catch', e)
|
console.error('idb open error', e)
|
||||||
idbAvailable = false;
|
idbAvailable = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log(idbAvailable);
|
|
||||||
if (!idbAvailable) console.error('indexedDB is unavailable. It will use localStorage.');
|
if (!idbAvailable) console.error('indexedDB is unavailable. It will use localStorage.');
|
||||||
|
|
||||||
export async function get(key: string) {
|
export async function get(key: string) {
|
||||||
|
|
Loading…
Reference in New Issue