diff options
Diffstat (limited to 'packages/taler-wallet-core')
-rw-r--r-- | packages/taler-wallet-core/src/db.ts | 37 |
1 files changed, 19 insertions, 18 deletions
diff --git a/packages/taler-wallet-core/src/db.ts b/packages/taler-wallet-core/src/db.ts index 4cc11d9eb..6b1fc2f5f 100644 --- a/packages/taler-wallet-core/src/db.ts +++ b/packages/taler-wallet-core/src/db.ts @@ -26,6 +26,7 @@ import { IDBRequest, IDBTransaction, structuredEncapsulate, + structuredRevive, } from "@gnu-taler/idb-bridge"; import { AbsoluteTime, @@ -577,11 +578,11 @@ export interface ExchangeDetailsRecord { * Information about ToS acceptance from the user. */ tosAccepted: - | { - etag: string; - timestamp: DbPreciseTimestamp; - } - | undefined; + | { + etag: string; + timestamp: DbPreciseTimestamp; + } + | undefined; wireInfo: WireInfo; @@ -1334,9 +1335,9 @@ export enum ConfigRecordKey { */ export type ConfigRecord = | { - key: ConfigRecordKey.WalletBackupState; - value: WalletBackupConfState; - } + key: ConfigRecordKey.WalletBackupState; + value: WalletBackupConfState; + } | { key: ConfigRecordKey.CurrencyDefaultsApplied; value: boolean } | { key: ConfigRecordKey.DevMode; value: boolean }; @@ -1603,15 +1604,15 @@ export enum BackupProviderStateTag { export type BackupProviderState = | { - tag: BackupProviderStateTag.Provisional; - } + tag: BackupProviderStateTag.Provisional; + } | { - tag: BackupProviderStateTag.Ready; - nextBackupTimestamp: DbPreciseTimestamp; - } + tag: BackupProviderStateTag.Ready; + nextBackupTimestamp: DbPreciseTimestamp; + } | { - tag: BackupProviderStateTag.Retrying; - }; + tag: BackupProviderStateTag.Retrying; + }; export interface BackupProviderTerms { supportedProtocolVersion: string; @@ -2840,7 +2841,7 @@ function checkDbDump(x: any): x is DbDump { } export async function importDb(db: IDBDatabase, dumpJson: any): Promise<void> { - const d = dumpJson; + const d = structuredRevive(dumpJson); if (checkDbDump(d)) { const walletDb = d.databases[TALER_WALLET_MAIN_DB_NAME]; if (!walletDb) { @@ -3069,7 +3070,7 @@ export async function openStoredBackupsDatabase( idbFactory, TALER_WALLET_STORED_BACKUPS_DB_NAME, 1, - () => { }, + () => {}, onStoredBackupsDbUpgradeNeeded, ); @@ -3092,7 +3093,7 @@ export async function openTalerDatabase( idbFactory, TALER_WALLET_META_DB_NAME, 1, - () => { }, + () => {}, onMetaDbUpgradeNeeded, ); |