From 7c37ce117c7be5e6c50328bd25b83f6db386f595 Mon Sep 17 00:00:00 2001 From: Todd Martin <106564991+trmartin4@users.noreply.github.com> Date: Wed, 14 Feb 2024 18:06:56 -0500 Subject: [PATCH] [PM-6241] Remove unused entityId and entityType state (#7899) * Removed unused entityId and entityType state * Removed from interface. * Removed unused state from AccountProfile. --- .../platform/abstractions/state.service.ts | 4 --- .../src/platform/models/domain/account.ts | 2 -- .../src/platform/services/state.service.ts | 34 ------------------- 3 files changed, 40 deletions(-) diff --git a/libs/common/src/platform/abstractions/state.service.ts b/libs/common/src/platform/abstractions/state.service.ts index 9e28536b65..b71344e6ce 100644 --- a/libs/common/src/platform/abstractions/state.service.ts +++ b/libs/common/src/platform/abstractions/state.service.ts @@ -343,10 +343,6 @@ export abstract class StateService { * @deprecated Do not call this directly, use SendService */ setEncryptedSends: (value: { [id: string]: SendData }, options?: StorageOptions) => Promise; - getEntityId: (options?: StorageOptions) => Promise; - setEntityId: (value: string, options?: StorageOptions) => Promise; - getEntityType: (options?: StorageOptions) => Promise; - setEntityType: (value: string, options?: StorageOptions) => Promise; getEquivalentDomains: (options?: StorageOptions) => Promise; setEquivalentDomains: (value: string, options?: StorageOptions) => Promise; getEventCollection: (options?: StorageOptions) => Promise; diff --git a/libs/common/src/platform/models/domain/account.ts b/libs/common/src/platform/models/domain/account.ts index 233276fa07..4db85a694e 100644 --- a/libs/common/src/platform/models/domain/account.ts +++ b/libs/common/src/platform/models/domain/account.ts @@ -181,8 +181,6 @@ export class AccountProfile { name?: string; email?: string; emailVerified?: boolean; - entityId?: string; - entityType?: string; everBeenUnlocked?: boolean; forceSetPasswordReason?: ForceSetPasswordReason; hasPremiumPersonally?: boolean; diff --git a/libs/common/src/platform/services/state.service.ts b/libs/common/src/platform/services/state.service.ts index be29627ef7..38174a79fe 100644 --- a/libs/common/src/platform/services/state.service.ts +++ b/libs/common/src/platform/services/state.service.ts @@ -1713,40 +1713,6 @@ export class StateService< ); } - async getEntityId(options?: StorageOptions): Promise { - return ( - await this.getAccount(this.reconcileOptions(options, await this.defaultOnDiskLocalOptions())) - )?.profile?.entityId; - } - - async setEntityId(value: string, options?: StorageOptions): Promise { - const account = await this.getAccount( - this.reconcileOptions(options, await this.defaultOnDiskLocalOptions()), - ); - account.profile.entityId = value; - await this.saveAccount( - account, - this.reconcileOptions(options, await this.defaultOnDiskLocalOptions()), - ); - } - - async getEntityType(options?: StorageOptions): Promise { - return ( - await this.getAccount(this.reconcileOptions(options, await this.defaultOnDiskLocalOptions())) - )?.profile?.entityType; - } - - async setEntityType(value: string, options?: StorageOptions): Promise { - const account = await this.getAccount( - this.reconcileOptions(options, await this.defaultOnDiskLocalOptions()), - ); - account.profile.entityType = value; - await this.saveAccount( - account, - this.reconcileOptions(options, await this.defaultOnDiskLocalOptions()), - ); - } - async getEquivalentDomains(options?: StorageOptions): Promise { return ( await this.getAccount(this.reconcileOptions(options, await this.defaultOnDiskOptions()))