mirror of https://github.com/bitwarden/web.git
5 changed files with 47 additions and 2 deletions
@ -1 +1 @@
@@ -1 +1 @@
|
||||
Subproject commit d68c1dafaf0528f5323dd595773b0fa122403d0d |
||||
Subproject commit e4cd0af2f9ae924f9b749fefe3695f7c69135bf6 |
||||
@ -0,0 +1,20 @@
@@ -0,0 +1,20 @@
|
||||
import { |
||||
Account as BaseAccount, |
||||
AccountSettings as BaseAccountSettings, |
||||
} from "jslib-common/models/domain/account"; |
||||
|
||||
export class AccountSettings extends BaseAccountSettings { |
||||
vaultTimeout: number = process.env.NODE_ENV === "development" ? null : 15; |
||||
} |
||||
|
||||
export class Account extends BaseAccount { |
||||
settings?: AccountSettings = new AccountSettings(); |
||||
|
||||
constructor(init: Partial<Account>) { |
||||
super(init); |
||||
Object.assign(this.settings, { |
||||
...new AccountSettings(), |
||||
...this.settings, |
||||
}); |
||||
} |
||||
} |
||||
@ -0,0 +1,13 @@
@@ -0,0 +1,13 @@
|
||||
import { StateService as BaseStateService } from "jslib-common/services/state.service"; |
||||
|
||||
import { Account } from "../models/account"; |
||||
|
||||
import { StateService as StateServiceAbstraction } from "jslib-common/abstractions/state.service"; |
||||
|
||||
export class StateService extends BaseStateService<Account> implements StateServiceAbstraction { |
||||
async addAccount(account: Account) { |
||||
// Apply web overides to default account values
|
||||
account = new Account(account); |
||||
await super.addAccount(account); |
||||
} |
||||
} |
||||
Loading…
Reference in new issue