2424 <v-card >
2525 <v-card-title class =" bg-primary d-flex align-center" >
2626 <v-icon icon =" mdi-security" />
27- <div class =" pl-2" >
28- Terms & Conditions
29- </div >
27+ <div class =" pl-2" >Terms & Conditions</div >
3028 </v-card-title >
3129
3230 <v-card-text class =" pb-0" >
3331 We use iDenfy to verify your identity.
34- <br >
32+ <br / >
3533 Please ensure you review iDenfy’s <span class =" font-weight-bold" >Security and Compliance</span >, which
3634 includes their <span class =" font-weight-bold" >Terms & Conditions, Privacy Policy</span >, and other relevant
3735 documents.
4644 </v-checkbox >
4745 </v-card-text >
4846 <v-card-actions class =" justify-end my-1 mr-2" >
49- <v-btn color =" anchor" @click =" handleAgreementDialog(false)" >
50- Cancel
51- </v-btn >
52- <v-btn :disabled =" !agreedCheckbox" @click =" handleAgreementDialog(true)" >
53- Continue
54- </v-btn >
47+ <v-btn color =" anchor" @click =" handleAgreementDialog(false)" > Cancel </v-btn >
48+ <v-btn :disabled =" !agreedCheckbox" @click =" handleAgreementDialog(true)" > Continue </v-btn >
5549 </v-card-actions >
5650 </v-card >
5751 </v-dialog >
@@ -85,6 +79,10 @@ export default {
8579 const agreed = ref (false );
8680 const agreedCheckbox = ref (false );
8781 const handleUpdateDialog = (event : boolean ) => {
82+ // Clean up listener when dialog closes
83+ if (! event ) {
84+ window .removeEventListener (" message" , handleReceiveMessage , false );
85+ }
8886 emit (" update:moduleValue" , event );
8987 };
9088 const handleAgreementDialog = (agreed : boolean ) => {
@@ -103,10 +101,14 @@ export default {
103101 agreed .value = true ;
104102 if (! kyc .client ) throw new Error (" KYC client is not initialized" );
105103 token .value = await kyc .client .getToken ();
104+ // Remove any existing listener before adding a new one to prevent duplicates
105+ window .removeEventListener (" message" , handleReceiveMessage , false );
106106 window .addEventListener (" message" , handleReceiveMessage , false );
107107 kycDialog .value = true ;
108108 } catch (e ) {
109109 handleUpdateDialog (false );
110+ // Clean up listener on error
111+ window .removeEventListener (" message" , handleReceiveMessage , false );
110112 if (e instanceof KycErrors .AlreadyVerified ) {
111113 kyc .updateStatus ();
112114 createCustomToast (" Already verified" , ToastType .info );
0 commit comments