Fix broken storeNames.forEach, since it's not an array
This commit is contained in:
parent
a728c9efbf
commit
c760fe29ac
1 changed files with 6 additions and 2 deletions
|
@ -1,5 +1,7 @@
|
||||||
/* global Whisper: false */
|
/* global Whisper: false */
|
||||||
/* global Backbone: false */
|
/* global Backbone: false */
|
||||||
|
/* global _: false */
|
||||||
|
|
||||||
/* eslint-disable more/no-then */
|
/* eslint-disable more/no-then */
|
||||||
|
|
||||||
// eslint-disable-next-line func-names
|
// eslint-disable-next-line func-names
|
||||||
|
@ -46,7 +48,9 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
let count = 0;
|
let count = 0;
|
||||||
storeNames.forEach((storeName) => {
|
|
||||||
|
// can't use built-in .forEach because db.objectStoreNames is not a plain array
|
||||||
|
_.forEach(storeNames, (storeName) => {
|
||||||
const store = transaction.objectStore(storeName);
|
const store = transaction.objectStore(storeName);
|
||||||
const request = store.clear();
|
const request = store.clear();
|
||||||
|
|
||||||
|
@ -55,7 +59,7 @@
|
||||||
console.log('Done clearing store', storeName);
|
console.log('Done clearing store', storeName);
|
||||||
|
|
||||||
if (count >= storeNames.length) {
|
if (count >= storeNames.length) {
|
||||||
console.log('Done clearing all indexeddb stores');
|
console.log('Done clearing indexeddb stores');
|
||||||
finish('clears complete');
|
finish('clears complete');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue