Skip to content

Commit

Permalink
This fixes onError not probagated to grandparent of the window
Browse files Browse the repository at this point in the history
  • Loading branch information
ayinloya committed Oct 10, 2024
1 parent 69376ca commit 4876fe8
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 6 deletions.
7 changes: 5 additions & 2 deletions packages/embed/src/js/basic-kyc.js
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,10 @@ import { version as sdkVersion } from '../../package.json';
EndUserConsent.addEventListener(
'end-user-consent.denied',
() => {
referenceWindow.postMessage('SmileIdentity::ConsentDenied', '*');
(referenceWindow.parent || referenceWindow).postMessage(
'SmileIdentity::ConsentDenied',
'*',
);
closeWindow();
},
false,
Expand All @@ -475,7 +478,7 @@ import { version as sdkVersion } from '../../package.json';
EndUserConsent.addEventListener(
'end-user-consent.totp.denied.contact-methods-outdated',
(event) => {
referenceWindow.postMessage(
(referenceWindow.parent || referenceWindow).postMessage(
'SmileIdentity::ConsentDenied::TOTP::ContactMethodsOutdated',
'*',
);
Expand Down
5 changes: 4 additions & 1 deletion packages/embed/src/js/biometric-kyc.js
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,10 @@ import { version as sdkVersion } from '../../package.json';
EndUserConsent.addEventListener(
'end-user-consent.denied',
() => {
referenceWindow.postMessage('SmileIdentity::ConsentDenied', '*');
(referenceWindow.parent || referenceWindow).postMessage(
'SmileIdentity::ConsentDenied',
'*',
);
closeWindow();
},
false,
Expand Down
5 changes: 4 additions & 1 deletion packages/embed/src/js/ekyc.js
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,10 @@ import { version as sdkVersion } from '../../package.json';
EndUserConsent.addEventListener(
'end-user-consent.denied',
() => {
referenceWindow.postMessage('SmileIdentity::ConsentDenied', '*');
(referenceWindow.parent || referenceWindow).postMessage(
'SmileIdentity::ConsentDenied',
'*',
);
closeWindow();
},
false,
Expand Down
4 changes: 2 additions & 2 deletions packages/embed/src/js/product-selection.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@

if (!validIdType) {
const legacyValidIdType =
legacyProductConstraints.doc_verification[country].id_types[id_type] ||
legacyProductConstraints.enhanced_kyc[country].id_types[id_type];
legacyProductConstraints.doc_verification[country]?.id_types[id_type] ||
legacyProductConstraints.enhanced_kyc[country]?.id_types[id_type];
if (legacyValidIdType) {
validIdType = {
name: legacyValidIdType.label,
Expand Down

0 comments on commit 4876fe8

Please sign in to comment.