fix error retrieving active DIDs; don't pop-up redundant toast warning when using current DID

This commit is contained in:
2026-01-08 19:51:48 -07:00
parent 9b2d14b418
commit 051af89476
3 changed files with 6 additions and 20 deletions

View File

@@ -43,12 +43,6 @@ export const NOTIFY_CONFIRMATION_ERROR = {
message: "There was a problem submitting the confirmation.", message: "There was a problem submitting the confirmation.",
}; };
// Used in: [Component usage not yet documented]
export const NOTIFY_DEFAULT_TO_ACTIVE_DID = {
title: "Your Info",
message: "No user was specified so showing your info.",
};
// Used in: [Component usage not yet documented] // Used in: [Component usage not yet documented]
export const NOTIFY_CONTACT_DELETED = { export const NOTIFY_CONTACT_DELETED = {
title: "Deleted", title: "Deleted",

View File

@@ -36,6 +36,11 @@ import { DEFAULT_ROOT_DERIVATION_PATH } from "./crypto";
import { UNNAMED_PERSON } from "@/constants/entities"; import { UNNAMED_PERSON } from "@/constants/entities";
// Consolidate this with src/utils/PlatformServiceMixin.mapQueryResultToValues // Consolidate this with src/utils/PlatformServiceMixin.mapQueryResultToValues
/**
* Translate DB query results into objects
* @param record is result of a database query
* @returns an array of objects (instead of nested arrays), each representing a row in the result
*/
function mapQueryResultToValues( function mapQueryResultToValues(
record: { columns: string[]; values: unknown[][] } | undefined, record: { columns: string[]; values: unknown[][] } | undefined,
): Array<Record<string, unknown>> { ): Array<Record<string, unknown>> {
@@ -575,7 +580,7 @@ export const retrieveAccountDids = async (): Promise<string[]> => {
const platformService = await getPlatformService(); const platformService = await getPlatformService();
const dbAccounts = await platformService.dbQuery(`SELECT did FROM accounts`); const dbAccounts = await platformService.dbQuery(`SELECT did FROM accounts`);
const allDids = const allDids =
mapQueryResultToValues(dbAccounts)?.map((row) => row[0] as string) || []; mapQueryResultToValues(dbAccounts)?.map((row) => row.did as string) || [];
return allDids; return allDids;
}; };

View File

@@ -344,7 +344,6 @@ import { logger } from "../utils/logger";
import { PlatformServiceMixin } from "@/utils/PlatformServiceMixin"; import { PlatformServiceMixin } from "@/utils/PlatformServiceMixin";
import { createNotifyHelpers, TIMEOUTS } from "@/utils/notify"; import { createNotifyHelpers, TIMEOUTS } from "@/utils/notify";
import { import {
NOTIFY_DEFAULT_TO_ACTIVE_DID,
NOTIFY_CONTACT_DELETED, NOTIFY_CONTACT_DELETED,
NOTIFY_CONTACT_DELETE_FAILED, NOTIFY_CONTACT_DELETE_FAILED,
NOTIFY_REGISTRATION_SUCCESS, NOTIFY_REGISTRATION_SUCCESS,
@@ -459,7 +458,6 @@ export default class DIDView extends Vue {
if (!showDid) { if (!showDid) {
// No DID provided in URL, use active DID // No DID provided in URL, use active DID
showDid = this.activeDid; showDid = this.activeDid;
this.notifyDefaultToActiveDID();
} else { } else {
// DID provided in URL, validate it // DID provided in URL, validate it
const decodedDid = decodeURIComponent(showDid); const decodedDid = decodeURIComponent(showDid);
@@ -475,17 +473,6 @@ export default class DIDView extends Vue {
this.viewingDid = showDid; this.viewingDid = showDid;
} }
/**
* Notifies user that we're showing their DID info by default
*/
private notifyDefaultToActiveDID() {
this.notify.toast(
NOTIFY_DEFAULT_TO_ACTIVE_DID.title,
NOTIFY_DEFAULT_TO_ACTIVE_DID.message,
TIMEOUTS.SHORT,
);
}
/** /**
* Loads contact information for the viewing DID * Loads contact information for the viewing DID
* Updates contact YAML representation if contact exists * Updates contact YAML representation if contact exists