diff --git a/jslib b/jslib index 009f69fcb1..82a51f5d17 160000 --- a/jslib +++ b/jslib @@ -1 +1 @@ -Subproject commit 009f69fcb1fc2168f015e5bc6de3a8583cbfe5fd +Subproject commit 82a51f5d17c3f25d7c24110b94db606ac117bcbc diff --git a/src/app/services/services.module.ts b/src/app/services/services.module.ts index 3982ffcb0b..7cd0b25b0d 100644 --- a/src/app/services/services.module.ts +++ b/src/app/services/services.module.ts @@ -191,7 +191,7 @@ export function initFactory( new StateMigrationService( storageService, secureStorageService, - new GlobalStateFactory(GlobalState) + new StateFactory(GlobalState, Account) ), deps: [StorageServiceAbstraction, "SECURE_STORAGE"], }, diff --git a/src/services/state.service.ts b/src/services/state.service.ts index 885d5b012b..ca0858ba4b 100644 --- a/src/services/state.service.ts +++ b/src/services/state.service.ts @@ -8,7 +8,7 @@ import { StateService as StateServiceAbstraction } from "../abstractions/state.s import { StorageOptions } from "jslib-common/models/domain/storageOptions"; export class StateService - extends BaseStateService + extends BaseStateService implements StateServiceAbstraction { async addAccount(account: Account) { diff --git a/src/services/stateMigration.service.ts b/src/services/stateMigration.service.ts index f30082a22e..86b2169307 100644 --- a/src/services/stateMigration.service.ts +++ b/src/services/stateMigration.service.ts @@ -1,10 +1,12 @@ import { StateMigrationService as BaseStateMigrationService } from "jslib-common/services/stateMigration.service"; + +import { Account } from "../models/account"; import { GlobalState } from "../models/globalState"; -export class StateMigrationService extends BaseStateMigrationService { +export class StateMigrationService extends BaseStateMigrationService { protected async migrationStateFrom1To2(): Promise { await super.migrateStateFrom1To2(); - const globals = (await this.get("global")) ?? this.globalStateFactory.create(); + const globals = (await this.get("global")) ?? this.stateFactory.createGlobal(null); globals.rememberEmail = (await this.get("rememberEmail")) ?? globals.rememberEmail; await this.set("global", globals); }