diff --git a/src/utils/PlatformServiceMixin.ts b/src/utils/PlatformServiceMixin.ts index 39b40afe..3a6ac7f2 100644 --- a/src/utils/PlatformServiceMixin.ts +++ b/src/utils/PlatformServiceMixin.ts @@ -236,45 +236,6 @@ export const PlatformServiceMixin = { } }, - /** - * Check if active identity needs user intervention - * Returns true if active_identity table is empty but accounts exist - * This allows components to show appropriate UI for user selection - */ - async $needsActiveIdentitySelection(): Promise { - try { - // Check if active_identity table has a valid activeDid - const activeIdentity = await this.$dbQuery( - "SELECT activeDid FROM active_identity WHERE id = 1", - ); - - const currentActiveDid = activeIdentity?.values?.[0]?.[0] as string; - - // If we have an activeDid, validate it exists in accounts - if (currentActiveDid) { - const accountExists = await this.$dbQuery( - "SELECT did FROM accounts WHERE did = ?", - [currentActiveDid], - ); - return !accountExists?.values?.length; - } - - // If no activeDid, check if there are any accounts available - const availableAccounts = await this.$dbQuery( - "SELECT COUNT(*) FROM accounts", - ); - const accountCount = availableAccounts?.values?.[0]?.[0] as number; - - return accountCount > 0; - } catch (error) { - logger.error( - "[PlatformServiceMixin] Error checking if active identity selection needed:", - error, - ); - return false; - } - }, - /** * Get available account DIDs for user selection * Returns array of DIDs that can be set as active identity @@ -722,7 +683,7 @@ export const PlatformServiceMixin = { "[PlatformServiceMixin] Active identity not found in accounts, clearing", ); await this.$dbExec( - "UPDATE active_identity SET activeDid = '', lastUpdated = datetime('now') WHERE id = 1", + "UPDATE active_identity SET activeDid = NULL, lastUpdated = datetime('now') WHERE id = 1", ); return { activeDid: "" }; } @@ -1975,7 +1936,6 @@ export interface IPlatformServiceMixin { ): Promise; $getActiveIdentity(): Promise<{ activeDid: string }>; $withTransaction(callback: () => Promise): Promise; - $needsActiveIdentitySelection(): Promise; $getAvailableAccountDids(): Promise; isCapacitor: boolean; isWeb: boolean; @@ -2100,7 +2060,6 @@ declare module "@vue/runtime-core" { ): Promise; $getActiveIdentity(): Promise<{ activeDid: string }>; $withTransaction(fn: () => Promise): Promise; - $needsActiveIdentitySelection(): Promise; $getAvailableAccountDids(): Promise; // Specialized shortcuts - contacts cached, settings fresh