[bug] Store collapsedGroupings in accountSettings (#694)

This commit is contained in:
Addison Beck 2022-02-25 07:03:13 -05:00 committed by GitHub
parent 1cbc119ad8
commit 65219f5705
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -51,7 +51,6 @@ export class AccountData {
GeneratedPasswordHistory[] GeneratedPasswordHistory[]
> = new EncryptionPair<GeneratedPasswordHistory[], GeneratedPasswordHistory[]>(); > = new EncryptionPair<GeneratedPasswordHistory[], GeneratedPasswordHistory[]>();
addEditCipherInfo?: any; addEditCipherInfo?: any;
collapsedGroupings?: string[];
eventCollection?: EventData[]; eventCollection?: EventData[];
organizations?: { [id: string]: OrganizationData }; organizations?: { [id: string]: OrganizationData };
providers?: { [id: string]: ProviderData }; providers?: { [id: string]: ProviderData };
@ -105,6 +104,7 @@ export class AccountSettings {
biometricLocked?: boolean; biometricLocked?: boolean;
biometricUnlock?: boolean; biometricUnlock?: boolean;
clearClipboard?: number; clearClipboard?: number;
collapsedGroupings?: string[];
defaultUriMatch?: UriMatchType; defaultUriMatch?: UriMatchType;
disableAddLoginNotification?: boolean; disableAddLoginNotification?: boolean;
disableAutoBiometricsPrompt?: boolean; disableAutoBiometricsPrompt?: boolean;

View File

@ -383,14 +383,14 @@ export class StateService<
async getCollapsedGroupings(options?: StorageOptions): Promise<string[]> { async getCollapsedGroupings(options?: StorageOptions): Promise<string[]> {
return ( return (
await this.getAccount(this.reconcileOptions(options, await this.defaultOnDiskLocalOptions())) await this.getAccount(this.reconcileOptions(options, await this.defaultOnDiskLocalOptions()))
)?.data?.collapsedGroupings; )?.settings?.collapsedGroupings;
} }
async setCollapsedGroupings(value: string[], options?: StorageOptions): Promise<void> { async setCollapsedGroupings(value: string[], options?: StorageOptions): Promise<void> {
const account = await this.getAccount( const account = await this.getAccount(
this.reconcileOptions(options, await this.defaultOnDiskLocalOptions()) this.reconcileOptions(options, await this.defaultOnDiskLocalOptions())
); );
account.data.collapsedGroupings = value; account.settings.collapsedGroupings = value;
await this.saveAccount( await this.saveAccount(
account, account,
this.reconcileOptions(options, await this.defaultOnDiskLocalOptions()) this.reconcileOptions(options, await this.defaultOnDiskLocalOptions())