|
|
@ -273,6 +273,7 @@ import { |
|
|
|
didInfoForContact, |
|
|
|
displayAmount, |
|
|
|
getHeaders, |
|
|
|
isDid, |
|
|
|
register, |
|
|
|
setVisibilityUtil, |
|
|
|
} from "../libs/endorserServer"; |
|
|
@ -289,6 +290,7 @@ import { |
|
|
|
NOTIFY_REGISTRATION_ERROR, |
|
|
|
NOTIFY_SERVER_ACCESS_ERROR, |
|
|
|
NOTIFY_NO_IDENTITY_ERROR, |
|
|
|
NOTIFY_CONTACT_INVALID_DID, |
|
|
|
} from "@/constants/notifications"; |
|
|
|
|
|
|
|
/** |
|
|
@ -379,22 +381,29 @@ export default class DIDView extends Vue { |
|
|
|
|
|
|
|
/** |
|
|
|
* Determines which DID to display based on URL parameters |
|
|
|
* Falls back to active DID if no parameter provided |
|
|
|
* Validates DID format and shows error for invalid DIDs |
|
|
|
*/ |
|
|
|
private async determineDIDToDisplay() { |
|
|
|
const pathParam = window.location.pathname.substring("/did/".length); |
|
|
|
let showDid = pathParam; |
|
|
|
|
|
|
|
if (!showDid) { |
|
|
|
// No DID provided in URL, use active DID |
|
|
|
showDid = this.activeDid; |
|
|
|
if (showDid) { |
|
|
|
this.notifyDefaultToActiveDID(); |
|
|
|
} else { |
|
|
|
// DID provided in URL, validate it |
|
|
|
const decodedDid = decodeURIComponent(showDid); |
|
|
|
if (!isDid(decodedDid)) { |
|
|
|
// Invalid DID format - show error and redirect |
|
|
|
this.notify.error(NOTIFY_CONTACT_INVALID_DID.message, TIMEOUTS.LONG); |
|
|
|
this.$router.push({ name: "home" }); |
|
|
|
return; |
|
|
|
} |
|
|
|
showDid = decodedDid; |
|
|
|
} |
|
|
|
|
|
|
|
if (showDid) { |
|
|
|
this.viewingDid = decodeURIComponent(showDid); |
|
|
|
} |
|
|
|
this.viewingDid = showDid; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|