[bug] Correct storage location of organizations (#580)

This commit is contained in:
Addison Beck 2021-12-14 22:04:39 -05:00 committed by GitHub
parent 3fc7dd7089
commit 512c5c2837
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -1081,13 +1081,13 @@ export class StateService implements StateServiceAbstraction {
} }
async getOrganizations(options?: StorageOptions): Promise<{ [id: string]: OrganizationData; }> { async getOrganizations(options?: StorageOptions): Promise<{ [id: string]: OrganizationData; }> {
return (await this.getAccount(this.reconcileOptions(options, this.defaultInMemoryOptions)))?.data?.organizations; return (await this.getAccount(this.reconcileOptions(options, await this.defaultOnDiskOptions())))?.data?.organizations;
} }
async setOrganizations(value: { [id: string]: OrganizationData; }, options?: StorageOptions): Promise<void> { async setOrganizations(value: { [id: string]: OrganizationData; }, options?: StorageOptions): Promise<void> {
const account = await this.getAccount(this.reconcileOptions(options, this.defaultInMemoryOptions)); const account = await this.getAccount(this.reconcileOptions(options, await this.defaultOnDiskOptions()));
account.data.organizations = value; account.data.organizations = value;
await this.saveAccount(account, this.reconcileOptions(options, this.defaultInMemoryOptions)); await this.saveAccount(account, this.reconcileOptions(options, await this.defaultOnDiskOptions()));
} }
async getPasswordGenerationOptions(options?: StorageOptions): Promise<any> { async getPasswordGenerationOptions(options?: StorageOptions): Promise<any> {