@ -273,6 +273,7 @@ import {
didInfoForContact ,
didInfoForContact ,
displayAmount ,
displayAmount ,
getHeaders ,
getHeaders ,
isDid ,
register ,
register ,
setVisibilityUtil ,
setVisibilityUtil ,
} from "../libs/endorserServer" ;
} from "../libs/endorserServer" ;
@ -289,6 +290,7 @@ import {
NOTIFY_REGISTRATION_ERROR ,
NOTIFY_REGISTRATION_ERROR ,
NOTIFY_SERVER_ACCESS_ERROR ,
NOTIFY_SERVER_ACCESS_ERROR ,
NOTIFY_NO_IDENTITY_ERROR ,
NOTIFY_NO_IDENTITY_ERROR ,
NOTIFY_CONTACT_INVALID_DID ,
} from "@/constants/notifications" ;
} from "@/constants/notifications" ;
/ * *
/ * *
@ -379,22 +381,29 @@ export default class DIDView extends Vue {
/ * *
/ * *
* Determines which DID to display based on URL parameters
* 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 ( ) {
private async determineDIDToDisplay ( ) {
const pathParam = window . location . pathname . substring ( "/did/" . length ) ;
const pathParam = window . location . pathname . substring ( "/did/" . length ) ;
let showDid = pathParam ;
let showDid = pathParam ;
if ( ! showDid ) {
if ( ! showDid ) {
/ / N o D I D p r o v i d e d i n U R L , u s e a c t i v e D I D
showDid = this . activeDid ;
showDid = this . activeDid ;
if ( showDid ) {
this . notifyDefaultToActiveDID ( ) ;
this . notifyDefaultToActiveDID ( ) ;
} else {
/ / D I D p r o v i d e d i n U R L , v a l i d a t e i t
const decodedDid = decodeURIComponent ( showDid ) ;
if ( ! isDid ( decodedDid ) ) {
/ / I n v a l i d D I D f o r m a t - s h o w e r r o r a n d r e d i r e c t
this . notify . error ( NOTIFY_CONTACT_INVALID_DID . message , TIMEOUTS . LONG ) ;
this . $router . push ( { name : "home" } ) ;
return ;
}
}
showDid = decodedDid ;
}
}
if ( showDid ) {
this . viewingDid = showDid ;
this . viewingDid = decodeURIComponent ( showDid ) ;
}
}
}
/ * *
/ * *