forked from jsnbuchanan/crowd-funder-for-time-pwa
feat: migrate TopMessage.vue to use new ActiveDid pattern
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".
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user