From c760fe29ac3f622c53f6646d4e9602c97982efad Mon Sep 17 00:00:00 2001 From: Scott Nonnenberg Date: Wed, 7 Mar 2018 17:27:35 -0800 Subject: [PATCH] Fix broken storeNames.forEach, since it's not an array --- js/database.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/js/database.js b/js/database.js index 84c4332f2240..19d524bda589 100644 --- a/js/database.js +++ b/js/database.js @@ -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'); } };