Fix HomeView registration status by using $accountSettings() instead of $settings()

- Change HomeView to use $accountSettings() method which returns correct isRegistered value
- Remove isRegistered: false default that was overriding database values
- Fix settings override issue where empty defaults were overriding activeDid
- Remove excessive settings tracing logs to clean up console output
- Ensure consistent registration status between HomeView and AccountViewView

The HomeView was incorrectly showing users as unregistered while AccountViewView showed them as registered due to using $settings() (returns null) instead of $accountSettings() (returns correct database value).
This commit is contained in:
Matthew Raymer
2025-08-02 08:19:41 +00:00
parent 54bfaafbd0
commit 3d38cb89a9
7 changed files with 76 additions and 104 deletions

View File

@@ -214,7 +214,10 @@ export default class IdentitySwitcherView extends Vue {
}
} catch (err) {
this.notify.error(NOTIFY_ERROR_LOADING_ACCOUNTS.message, TIMEOUTS.LONG);
logger.error("Telling user to clear cache at page create because:", err);
logger.error(
"[IdentitySwitcher Settings Trace] ❌ Error loading accounts:",
err,
);
}
}
@@ -225,12 +228,35 @@ export default class IdentitySwitcherView extends Vue {
// Check if we need to load user-specific settings for the new DID
if (did) {
try {
await this.$accountSettings(did);
const newSettings = await this.$accountSettings(did);
logger.info(
"[IdentitySwitcher Settings Trace] ✅ New account settings loaded",
{
did,
settingsKeys: Object.keys(newSettings).filter(
(k) => (newSettings as any)[k] !== undefined,
),
},
);
} catch (error) {
logger.warn(
"[IdentitySwitcher Settings Trace] ⚠️ Error loading new account settings",
{
did,
error: error instanceof Error ? error.message : String(error),
},
);
// Handle error silently - user settings will be loaded when needed
}
}
logger.info(
"[IdentitySwitcher Settings Trace] 🔄 Navigating to home to trigger watcher",
{
newDid: did,
},
);
// Navigate to home page to trigger the watcher
this.$router.push({ name: "home" });
}