From 1814aaa46611ca03796d54ebbf01615d1b343fff Mon Sep 17 00:00:00 2001 From: Jordan Eldredge Date: Thu, 11 Oct 2018 20:09:34 -0700 Subject: [PATCH] Don't construc the indexeddb by default This seems to be causing errors for some people. I think I should probably write the IndexedDB integration myself. --- js/indexedDB.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/js/indexedDB.js b/js/indexedDB.js index fd568ac9..68040f55 100644 --- a/js/indexedDB.js +++ b/js/indexedDB.js @@ -3,6 +3,9 @@ import { throttle } from "./utils"; const LOCAL_STORAGE_KEY = "webamp_state"; export async function bindToIndexedDB(webamp, clearState, useState) { + if (!useState) { + return; + } const localStore = new IdbKvStore("webamp_state_database"); if (clearState) { @@ -13,10 +16,6 @@ export async function bindToIndexedDB(webamp, clearState, useState) { } } - if (!useState) { - return; - } - let previousSerializedState = null; try { previousSerializedState = await localStore.get(LOCAL_STORAGE_KEY);