1
0
mirror of https://github.com/bitwarden/jslib synced 2025-12-22 19:23:24 +00:00

[review] [bug] Adjust state scope for OrganizationInvitation

This commit is contained in:
addison
2021-11-11 12:24:27 -05:00
parent fbe3e02b15
commit caa4574a65
3 changed files with 5 additions and 5 deletions

View File

@@ -126,6 +126,7 @@ export class Account {
convertAccountToKeyConnector: boolean; convertAccountToKeyConnector: boolean;
usesKeyConnector: boolean; usesKeyConnector: boolean;
enableFullWidth: boolean; enableFullWidth: boolean;
organizationInvitation: any;
private hasPremiumPersonally: boolean; private hasPremiumPersonally: boolean;

View File

@@ -4,7 +4,6 @@ export class GlobalState {
lastActive: number; lastActive: number;
locale: string; locale: string;
openAtLogin: boolean; openAtLogin: boolean;
organizationInvitation: any;
rememberEmail: boolean; rememberEmail: boolean;
rememberedEmail: string; rememberedEmail: string;
theme: string; theme: string;

View File

@@ -946,12 +946,12 @@ export class StateService implements StateServiceAbstraction {
} }
async getOrganizationInvitation(options?: StorageOptions): Promise<any> { async getOrganizationInvitation(options?: StorageOptions): Promise<any> {
return (await this.getGlobals(this.reconcileOptions(options, this.defaultInMemoryOptions))).organizationInvitation; return (await this.getAccount(this.reconcileOptions(options, this.defaultOnDiskOptions))).organizationInvitation;
} }
async setOrganizationInvitation(value: any, options?: StorageOptions): Promise<void> { async setOrganizationInvitation(value: any, options?: StorageOptions): Promise<void> {
const globals = await this.getGlobals(this.reconcileOptions(options, this.defaultInMemoryOptions)); const account = await this.getAccount(this.reconcileOptions(options, this.defaultOnDiskOptions));
globals.organizationInvitation = value; account.organizationInvitation = value;
await this.saveGlobals(globals, this.reconcileOptions(options, this.defaultInMemoryOptions)); await this.saveAccount(account, this.reconcileOptions(options, this.defaultOnDiskOptions));
} }
async getOrganizations(options?: StorageOptions): Promise<{ [id: string]: OrganizationData; }> { async getOrganizations(options?: StorageOptions): Promise<{ [id: string]: OrganizationData; }> {