mirror of
https://github.com/bitwarden/jslib
synced 2025-12-06 00:03:29 +00:00
[review] [bug] Adjust state scope for OrganizationInvitation
This commit is contained in:
@@ -126,6 +126,7 @@ export class Account {
|
||||
convertAccountToKeyConnector: boolean;
|
||||
usesKeyConnector: boolean;
|
||||
enableFullWidth: boolean;
|
||||
organizationInvitation: any;
|
||||
|
||||
private hasPremiumPersonally: boolean;
|
||||
|
||||
|
||||
@@ -4,7 +4,6 @@ export class GlobalState {
|
||||
lastActive: number;
|
||||
locale: string;
|
||||
openAtLogin: boolean;
|
||||
organizationInvitation: any;
|
||||
rememberEmail: boolean;
|
||||
rememberedEmail: string;
|
||||
theme: string;
|
||||
|
||||
@@ -946,12 +946,12 @@ export class StateService implements StateServiceAbstraction {
|
||||
}
|
||||
|
||||
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> {
|
||||
const globals = await this.getGlobals(this.reconcileOptions(options, this.defaultInMemoryOptions));
|
||||
globals.organizationInvitation = value;
|
||||
await this.saveGlobals(globals, this.reconcileOptions(options, this.defaultInMemoryOptions));
|
||||
const account = await this.getAccount(this.reconcileOptions(options, this.defaultOnDiskOptions));
|
||||
account.organizationInvitation = value;
|
||||
await this.saveAccount(account, this.reconcileOptions(options, this.defaultOnDiskOptions));
|
||||
}
|
||||
|
||||
async getOrganizations(options?: StorageOptions): Promise<{ [id: string]: OrganizationData; }> {
|
||||
|
||||
Reference in New Issue
Block a user