Changeset View
Changeset View
Standalone View
Standalone View
web/database/worker/db-worker.js
Show All 17 Lines | const localforageConfig: PartialConfig = { | ||||
driver: localforage.INDEXEDDB, | driver: localforage.INDEXEDDB, | ||||
name: 'comm', | name: 'comm', | ||||
storeName: 'commStorage', | storeName: 'commStorage', | ||||
description: 'Comm encrypted database storage', | description: 'Comm encrypted database storage', | ||||
version: '1.0', | version: '1.0', | ||||
}; | }; | ||||
localforage.config(localforageConfig); | localforage.config(localforageConfig); | ||||
let sqliteDb = null; | let sqliteDb: ?SqliteDatabase = null; | ||||
async function initDatabase(sqljsFilePath: string, sqljsFilename: ?string) { | async function initDatabase(sqljsFilePath: string, sqljsFilename: ?string) { | ||||
const content = await localforage.getItem(SQLITE_CONTENT); | const content = await localforage.getItem(SQLITE_CONTENT); | ||||
const locateFile = defaultFilename => { | const locateFile = defaultFilename => { | ||||
if (sqljsFilename) { | if (sqljsFilename) { | ||||
return `${sqljsFilePath}/${sqljsFilename}`; | return `${sqljsFilePath}/${sqljsFilename}`; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 75 Lines • Show Last 20 Lines |