Fix broken storeNames.forEach, since it's not an array

This commit is contained in:
Scott Nonnenberg 2018-03-07 17:27:35 -08:00 committed by Scott Nonnenberg
parent a728c9efbf
commit c760fe29ac
No known key found for this signature in database
GPG Key ID: 5F82280C35134661
1 changed files with 6 additions and 2 deletions

View File

@ -1,5 +1,7 @@
/* global Whisper: false */
/* global Backbone: false */
/* global _: false */
/* eslint-disable more/no-then */
// eslint-disable-next-line func-names
@ -46,7 +48,9 @@
};
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 request = store.clear();
@ -55,7 +59,7 @@
console.log('Done clearing store', storeName);
if (count >= storeNames.length) {
console.log('Done clearing all indexeddb stores');
console.log('Done clearing indexeddb stores');
finish('clears complete');
}
};