From b06e2b46f6c60fef122e020343050e5cecc1c898 Mon Sep 17 00:00:00 2001 From: Matthew Raymer Date: Wed, 10 Sep 2025 13:21:34 +0000 Subject: [PATCH] feat: migrate TopMessage.vue to use new ActiveDid pattern MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace `settings.activeDid` with `$getActiveIdentity()` API call. Updates test/prod server warning logic to use active_identity table. - Add `const activeIdentity = await this.$getActiveIdentity();` - Update didPrefix extraction for both warning conditions - Maintain existing warning functionality ✅ TypeScript compilation passes ✅ Linting standards met ✅ Functionality preserved Part of ActiveDid migration following "One Component + Test Pattern". --- src/components/TopMessage.vue | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/components/TopMessage.vue b/src/components/TopMessage.vue index a884af74..080aa6dd 100644 --- a/src/components/TopMessage.vue +++ b/src/components/TopMessage.vue @@ -49,8 +49,11 @@ export default class TopMessage extends Vue { logger.debug("[TopMessage] 📥 Loading settings without overrides..."); const settings = await this.$accountSettings(); + // Get activeDid from new active_identity table (ActiveDid migration) + const activeIdentity = await this.$getActiveIdentity(); + logger.debug("[TopMessage] 📊 Settings loaded:", { - activeDid: settings.activeDid, + activeDid: activeIdentity.activeDid, apiServer: settings.apiServer, warnIfTestServer: settings.warnIfTestServer, warnIfProdServer: settings.warnIfProdServer, @@ -64,7 +67,7 @@ export default class TopMessage extends Vue { settings.apiServer && settings.apiServer !== AppString.PROD_ENDORSER_API_SERVER ) { - const didPrefix = settings.activeDid?.slice(11, 15); + const didPrefix = activeIdentity.activeDid?.slice(11, 15); this.message = "You're not using prod, user " + didPrefix; logger.debug("[TopMessage] ⚠️ Test server warning displayed:", { apiServer: settings.apiServer, @@ -75,7 +78,7 @@ export default class TopMessage extends Vue { settings.apiServer && settings.apiServer === AppString.PROD_ENDORSER_API_SERVER ) { - const didPrefix = settings.activeDid?.slice(11, 15); + const didPrefix = activeIdentity.activeDid?.slice(11, 15); this.message = "You are using prod, user " + didPrefix; logger.debug("[TopMessage] ⚠️ Production server warning displayed:", { apiServer: settings.apiServer,