1
0
mirror of https://github.com/bitwarden/jslib synced 2025-12-16 08:13:26 +00:00

[feat(Account Switching)] Allow for extending application state (#584)

* [feat(Account Switching)] Allow for extending application state

* [bug(Account Switching)] Remove hardcoded dev urls

* [bug(Account Switching)] Init Account when signing in

* [bug(Account Switching)] Check for state migration version in local storage for web

* [bug(Account Switching)] Fix never lock configurations

* [chore] Prettier merge

* [bug] Move environmentUrls to global state

* [chore] Ran prettier

* [bug]change storage location for enityId and type

* [style] Ran prettier

Co-authored-by: Robyn MacCallum <robyntmaccallum@gmail.com>
This commit is contained in:
Addison Beck
2021-12-20 08:48:47 -05:00
committed by GitHub
parent 59a5300458
commit 9e26336549
11 changed files with 198 additions and 179 deletions

View File

@@ -24,11 +24,11 @@ import { CollectionView } from "../models/view/collectionView";
import { FolderView } from "../models/view/folderView";
import { SendView } from "../models/view/sendView";
export abstract class StateService {
accounts: BehaviorSubject<{ [userId: string]: Account }>;
export abstract class StateService<T extends Account = Account> {
accounts: BehaviorSubject<{ [userId: string]: T }>;
activeAccount: BehaviorSubject<string>;
addAccount: (account: Account) => Promise<void>;
addAccount: (account: T) => Promise<void>;
setActiveUser: (userId: string) => Promise<void>;
clean: (options?: StorageOptions) => Promise<void>;
init: () => Promise<void>;