From adab77089c08957ffa2233418e00da319565aedd Mon Sep 17 00:00:00 2001 From: Denis Lisov Date: Mon, 29 Apr 2024 01:43:41 +0300 Subject: [PATCH] Database._open: remove remains of `storage` support --- modules/database.js | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/modules/database.js b/modules/database.js index 0eec4f5d..be7f1f6c 100644 --- a/modules/database.js +++ b/modules/database.js @@ -120,20 +120,12 @@ export let Database = { return this; }, - async _open({name="brief", version=undefined, storage="default", upgrade=null}) { - let description = `database in ${storage} storage`; + async _open({name="brief", version=undefined, upgrade=null}) { let canUpgrade = (upgrade !== null); - console.log(`Brief: opening ${description}${ canUpgrade ? " with upgrade" : "" }`); - let openOptions = version; - if(storage === 'persistent') { - openOptions = { - storage: 'persistent', - version, - }; - } + console.log(`Brief: opening database${ canUpgrade ? " with upgrade" : "" }`); let db; let upgradeFrom; - let opener = indexedDB.open(name, openOptions); + let opener = indexedDB.open(name, version); if(upgrade !== null) { opener.onupgradeneeded = (event) => upgrade(event); } else { @@ -148,16 +140,16 @@ export let Database = { } catch(e) { if(e.name === "AbortError" && !canUpgrade) { if(upgradeFrom === 0) { - console.info(`Found no ${description}`); + console.info(`Found no database`); } else { - console.info(`The ${description} needs upgrade, aborting`); + console.info(`The database needs upgrade, aborting`); } } else { console.error("Error opening database:", e.name, e.message); } return null; } - console.log(`Brief: opened ${description}`); + console.log(`Brief: opened database`); return db; },