2022-01-27 22:22:51 +01:00
|
|
|
import {
|
|
|
|
Account as BaseAccount,
|
|
|
|
AccountSettings as BaseAccountSettings,
|
2022-06-14 17:10:53 +02:00
|
|
|
} from "@bitwarden/common/models/domain/account";
|
2022-01-27 22:22:51 +01:00
|
|
|
|
|
|
|
import { BrowserComponentState } from "./browserComponentState";
|
|
|
|
import { BrowserGroupingsComponentState } from "./browserGroupingsComponentState";
|
|
|
|
import { BrowserSendComponentState } from "./browserSendComponentState";
|
|
|
|
|
|
|
|
export class AccountSettings extends BaseAccountSettings {
|
2022-02-24 18:14:04 +01:00
|
|
|
vaultTimeout = -1; // On Restart
|
2022-01-27 22:22:51 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
export class Account extends BaseAccount {
|
|
|
|
settings?: AccountSettings = new AccountSettings();
|
|
|
|
groupings?: BrowserGroupingsComponentState;
|
|
|
|
send?: BrowserSendComponentState;
|
|
|
|
ciphers?: BrowserComponentState;
|
|
|
|
sendType?: BrowserComponentState;
|
|
|
|
|
|
|
|
constructor(init: Partial<Account>) {
|
|
|
|
super(init);
|
|
|
|
Object.assign(this.settings, {
|
|
|
|
...new AccountSettings(),
|
|
|
|
...this.settings,
|
|
|
|
});
|
|
|
|
this.groupings = init?.groupings ?? new BrowserGroupingsComponentState();
|
|
|
|
this.send = init?.send ?? new BrowserSendComponentState();
|
|
|
|
this.ciphers = init?.ciphers ?? new BrowserComponentState();
|
|
|
|
this.sendType = init?.sendType ?? new BrowserComponentState();
|
|
|
|
}
|
|
|
|
}
|