From 50239a49df82bd43396318bcc4a7098bce687345 Mon Sep 17 00:00:00 2001 From: tophf Date: Sun, 3 Sep 2017 21:56:46 +0300 Subject: [PATCH] fixup 53aa239d for new installations --- background/storage.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/background/storage.js b/background/storage.js index 84495745..6da7a4a8 100644 --- a/background/storage.js +++ b/background/storage.js @@ -119,11 +119,15 @@ do { .then(({target}) => ( (target.result || [])[0] ? Promise.reject('ok') : - dbExecIndexedDB('get', -1))) + dbExecIndexedDB('put', {id: -1}))) + .then(() => + dbExecIndexedDB('get', -1)) .then(({target}) => ( (target.result || {}).id === -1 ? - dbExecIndexedDB('delete', -1).then(() => 'ok') : + dbExecIndexedDB('delete', -1) : Promise.reject())) + .then(() => + Promise.reject('ok')) .catch(result => { if (result === 'ok') { chromeLocal.set({dbInChromeStorage: false});