1
0
mirror of https://github.com/bitwarden/web synced 2025-12-11 13:53:17 +00:00

Update jslib (#1436)

This commit is contained in:
Addison Beck
2022-02-03 13:54:15 -05:00
committed by addison
parent ebcb4375b6
commit 098874f787
4 changed files with 7 additions and 5 deletions

2
jslib

Submodule jslib updated: 009f69fcb1...82a51f5d17

View File

@@ -191,7 +191,7 @@ export function initFactory(
new StateMigrationService( new StateMigrationService(
storageService, storageService,
secureStorageService, secureStorageService,
new GlobalStateFactory(GlobalState) new StateFactory(GlobalState, Account)
), ),
deps: [StorageServiceAbstraction, "SECURE_STORAGE"], deps: [StorageServiceAbstraction, "SECURE_STORAGE"],
}, },

View File

@@ -8,7 +8,7 @@ import { StateService as StateServiceAbstraction } from "../abstractions/state.s
import { StorageOptions } from "jslib-common/models/domain/storageOptions"; import { StorageOptions } from "jslib-common/models/domain/storageOptions";
export class StateService export class StateService
extends BaseStateService<Account, GlobalState> extends BaseStateService<GlobalState, Account>
implements StateServiceAbstraction implements StateServiceAbstraction
{ {
async addAccount(account: Account) { async addAccount(account: Account) {

View File

@@ -1,10 +1,12 @@
import { StateMigrationService as BaseStateMigrationService } from "jslib-common/services/stateMigration.service"; import { StateMigrationService as BaseStateMigrationService } from "jslib-common/services/stateMigration.service";
import { Account } from "../models/account";
import { GlobalState } from "../models/globalState"; import { GlobalState } from "../models/globalState";
export class StateMigrationService extends BaseStateMigrationService<GlobalState> { export class StateMigrationService extends BaseStateMigrationService<GlobalState, Account> {
protected async migrationStateFrom1To2(): Promise<void> { protected async migrationStateFrom1To2(): Promise<void> {
await super.migrateStateFrom1To2(); await super.migrateStateFrom1To2();
const globals = (await this.get<GlobalState>("global")) ?? this.globalStateFactory.create(); const globals = (await this.get<GlobalState>("global")) ?? this.stateFactory.createGlobal(null);
globals.rememberEmail = (await this.get<boolean>("rememberEmail")) ?? globals.rememberEmail; globals.rememberEmail = (await this.get<boolean>("rememberEmail")) ?? globals.rememberEmail;
await this.set("global", globals); await this.set("global", globals);
} }