1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-15 07:43:35 +00:00

[PM-7917] Remove session sync (#9024)

* Remove session sync and MemoryStorageService

* Fix merge
This commit is contained in:
Matt Gibson
2024-05-07 13:25:49 -04:00
committed by GitHub
parent c241aba025
commit de0852431a
29 changed files with 41 additions and 902 deletions

View File

@@ -14,10 +14,7 @@ import {
InitOptions,
StateService as StateServiceAbstraction,
} from "../abstractions/state.service";
import {
AbstractMemoryStorageService,
AbstractStorageService,
} from "../abstractions/storage.service";
import { AbstractStorageService } from "../abstractions/storage.service";
import { HtmlStorageLocation, StorageLocation } from "../enums";
import { StateFactory } from "../factories/state-factory";
import { Utils } from "../misc/utils";
@@ -61,7 +58,7 @@ export class StateService<
constructor(
protected storageService: AbstractStorageService,
protected secureStorageService: AbstractStorageService,
protected memoryStorageService: AbstractMemoryStorageService,
protected memoryStorageService: AbstractStorageService,
protected logService: LogService,
protected stateFactory: StateFactory<TGlobalState, TAccount>,
protected accountService: AccountService,
@@ -1111,9 +1108,10 @@ export class StateService<
}
protected async state(): Promise<State<TGlobalState, TAccount>> {
const state = await this.memoryStorageService.get<State<TGlobalState, TAccount>>(keys.state, {
deserializer: (s) => State.fromJSON(s, this.accountDeserializer),
});
let state = await this.memoryStorageService.get<State<TGlobalState, TAccount>>(keys.state);
if (this.memoryStorageService.valuesRequireDeserialization) {
state = State.fromJSON(state, this.accountDeserializer);
}
return state;
}