mirror of
https://github.com/bitwarden/browser.git
synced 2024-11-09 09:51:02 +01:00
Save localData to local storage instead of in memory (#683)
This commit is contained in:
parent
240fc154ab
commit
5de59c32ab
@ -1613,16 +1613,19 @@ export class StateService<
|
|||||||
}
|
}
|
||||||
|
|
||||||
async getLocalData(options?: StorageOptions): Promise<any> {
|
async getLocalData(options?: StorageOptions): Promise<any> {
|
||||||
return (await this.getAccount(this.reconcileOptions(options, this.defaultInMemoryOptions)))
|
return (
|
||||||
?.data?.localData;
|
await this.getAccount(this.reconcileOptions(options, await this.defaultOnDiskLocalOptions()))
|
||||||
|
)?.data?.localData;
|
||||||
}
|
}
|
||||||
|
|
||||||
async setLocalData(value: string, options?: StorageOptions): Promise<void> {
|
async setLocalData(value: string, options?: StorageOptions): Promise<void> {
|
||||||
const account = await this.getAccount(
|
const account = await this.getAccount(
|
||||||
this.reconcileOptions(options, this.defaultInMemoryOptions)
|
this.reconcileOptions(options, await this.defaultOnDiskLocalOptions())
|
||||||
);
|
);
|
||||||
account.data.localData = value;
|
account.data.localData = value;
|
||||||
await this.saveAccount(account, this.reconcileOptions(options, this.defaultInMemoryOptions));
|
await this.saveAccount(
|
||||||
|
account,
|
||||||
|
this.reconcileOptions(options, await this.defaultOnDiskLocalOptions())
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
async getLocale(options?: StorageOptions): Promise<string> {
|
async getLocale(options?: StorageOptions): Promise<string> {
|
||||||
|
Loading…
Reference in New Issue
Block a user