@ -104,7 +104,6 @@ import { Buffer } from "buffer/";
import QRCodeVue3 from "qr-code-generator-vue3" ;
import { Component , Vue } from "vue-facing-decorator" ;
import { Router } from "vue-router" ;
import { useClipboard } from "@vueuse/core" ;
import { logger } from "../utils/logger" ;
import { QRScannerFactory } from "../services/QRScanner/QRScannerFactory" ;
@ -196,7 +195,7 @@ export default class ContactQRScanFull extends Vue {
$router ! : Router ;
/ / N o t i f i c a t i o n h e l p e r s y s t e m
private notify = createNotifyHelpers ( this . $notify ) ;
private notify ! : ReturnType < typeof createNotifyHelpers > ;
isScanning = false ;
error : string | null = null ;
@ -264,6 +263,9 @@ export default class ContactQRScanFull extends Vue {
* Loads user settings and generates QR code for contact sharing
* /
async created ( ) {
/ / I n i t i a l i z e n o t i f i c a t i o n h e l p e r s y s t e m
this . notify = createNotifyHelpers ( this . $notify ) ;
try {
const settings = await this . $accountSettings ( ) ;
this . activeDid = settings . activeDid || "" ;
@ -646,36 +648,53 @@ export default class ContactQRScanFull extends Vue {
* Copies contact URL to clipboard for sharing
* /
async onCopyUrlToClipboard ( ) {
const account = ( await libsUtil . retrieveFullyDecryptedAccount (
this . activeDid ,
) ) as Account ;
const jwtUrl = await generateEndorserJwtUrlForAccount (
account ,
this . isRegistered ,
this . givenName ,
this . profileImageUrl ,
true ,
) ;
useClipboard ( )
. copy ( jwtUrl )
. then ( ( ) => {
this . notify . toast (
NOTIFY_QR_URL_COPIED . title ,
NOTIFY_QR_URL_COPIED . message ,
QR_TIMEOUT_MEDIUM ,
) ;
try {
const account = ( await libsUtil . retrieveFullyDecryptedAccount (
this . activeDid ,
) ) as Account ;
const jwtUrl = await generateEndorserJwtUrlForAccount (
account ,
this . isRegistered ,
this . givenName ,
this . profileImageUrl ,
true ,
) ;
/ / U s e t h e p l a t f o r m - s p e c i f i c C l i p b o a r d S e r v i c e f o r r e l i a b l e i O S s u p p o r t
const { copyToClipboard } = await import ( "../services/ClipboardService" ) ;
await copyToClipboard ( jwtUrl ) ;
this . notify . toast (
NOTIFY_QR_URL_COPIED . title ,
NOTIFY_QR_URL_COPIED . message ,
QR_TIMEOUT_MEDIUM ,
) ;
} catch ( error ) {
logger . error ( "Error copying URL to clipboard:" , {
error : error instanceof Error ? error . message : String ( error ) ,
stack : error instanceof Error ? error . stack : undefined ,
} ) ;
this . notify . error ( "Failed to copy URL to clipboard." ) ;
}
}
/ * *
* Copies DID to clipboard for manual sharing
* /
onCopyDidToClipboard ( ) {
useClipboard ( )
. copy ( this . activeDid )
. then ( ( ) => {
this . notify . info ( NOTIFY_QR_DID_COPIED . message , QR_TIMEOUT_LONG ) ;
async onCopyDidToClipboard ( ) {
try {
/ / U s e t h e p l a t f o r m - s p e c i f i c C l i p b o a r d S e r v i c e f o r r e l i a b l e i O S s u p p o r t
const { copyToClipboard } = await import ( "../services/ClipboardService" ) ;
await copyToClipboard ( this . activeDid ) ;
this . notify . info ( NOTIFY_QR_DID_COPIED . message , QR_TIMEOUT_LONG ) ;
} catch ( error ) {
logger . error ( "Error copying DID to clipboard:" , {
error : error instanceof Error ? error . message : String ( error ) ,
stack : error instanceof Error ? error . stack : undefined ,
} ) ;
this . notify . error ( "Failed to copy DID to clipboard." ) ;
}
}
/ * *