Skip to content

Commit

Permalink
feat: [CM-728] Tracks popup blocked event (#1952)
Browse files Browse the repository at this point in the history
  • Loading branch information
alejoloaiza authored Jul 1, 2024
1 parent 39bd920 commit 7028142
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/passport/sdk/src/confirmation/confirmation.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { TransactionApprovalRequestChainTypeEnum } from '@imtbl/guardian';
import { trackError } from '@imtbl/metrics';

import {
ConfirmationResult,
PASSPORT_EVENT_TYPE,
Expand Down Expand Up @@ -180,8 +182,10 @@ export default class ConfirmationScreen {
height: popupOptions?.height || CONFIRMATION_WINDOW_HEIGHT,
});
this.overlay = new Overlay(this.config.popupOverlayOptions);
} catch (e) {
} catch (error) {
// If an error is thrown here then the popup is blocked
const errorMessage = error instanceof Error ? error.message : String(error);
trackError('passport', 'confirmationPopupDenied', new Error(errorMessage));
this.overlay = new Overlay(this.config.popupOverlayOptions, true);
}

Expand Down

0 comments on commit 7028142

Please sign in to comment.