mirror of
https://github.com/bitwarden/browser
synced 2025-12-16 08:13:42 +00:00
[bug] Default rememberEmail to true (#1429)
This commit is contained in:
@@ -1,13 +1,36 @@
|
||||
import { StateService as BaseStateService } from "jslib-common/services/state.service";
|
||||
|
||||
import { Account } from "../models/account";
|
||||
import { GlobalState } from "../models/globalState";
|
||||
|
||||
import { StateService as StateServiceAbstraction } from "jslib-common/abstractions/state.service";
|
||||
import { StateService as StateServiceAbstraction } from "../abstractions/state.service";
|
||||
|
||||
export class StateService extends BaseStateService<Account> implements StateServiceAbstraction {
|
||||
import { StorageOptions } from "jslib-common/models/domain/storageOptions";
|
||||
|
||||
export class StateService
|
||||
extends BaseStateService<Account, GlobalState>
|
||||
implements StateServiceAbstraction
|
||||
{
|
||||
async addAccount(account: Account) {
|
||||
// Apply web overides to default account values
|
||||
account = new Account(account);
|
||||
await super.addAccount(account);
|
||||
}
|
||||
|
||||
async getRememberEmail(options?: StorageOptions) {
|
||||
return (
|
||||
await this.getGlobals(this.reconcileOptions(options, await this.defaultOnDiskLocalOptions()))
|
||||
)?.rememberEmail;
|
||||
}
|
||||
|
||||
async setRememberEmail(value: boolean, options?: StorageOptions): Promise<void> {
|
||||
const globals = await this.getGlobals(
|
||||
this.reconcileOptions(options, await this.defaultOnDiskLocalOptions())
|
||||
);
|
||||
globals.rememberEmail = value;
|
||||
await this.saveGlobals(
|
||||
globals,
|
||||
this.reconcileOptions(options, await this.defaultOnDiskLocalOptions())
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user