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:
@@ -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;
|
||||||
|
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -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; }> {
|
||||||
|
|||||||
Reference in New Issue
Block a user