From e36ed6067c61c9d79fedd10bb0d8b87abe1a661d Mon Sep 17 00:00:00 2001 From: Shraddha Shah Date: Tue, 4 Jun 2024 00:30:48 -0700 Subject: [PATCH] fix: separate detected close errors to reject promise case --- src/constants.js | 1 - src/parent/parent.js | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/constants.js b/src/constants.js index 77394658..9a1b0e46 100644 --- a/src/constants.js +++ b/src/constants.js @@ -14,7 +14,6 @@ export const COMPONENT_ERROR = { COMPONENT_DESTROYED: "Component destroyed", COMPONENT_CLOSED: "Component closed", WINDOW_CLOSED: "Detected component window close", - POPUP_CLOSE: "Detected popup close", IFRAME_CLOSE: "Detected iframe close", }; diff --git a/src/parent/parent.js b/src/parent/parent.js index 8353a5f5..070c8f9c 100644 --- a/src/parent/parent.js +++ b/src/parent/parent.js @@ -884,7 +884,7 @@ export function parentComponent({ .then((isClosed) => { if (!cancelled) { if (context === CONTEXT.POPUP && isClosed) { - return close(new Error(COMPONENT_ERROR.POPUP_CLOSE)); + return close(new Error("Detected popup close")); } const isCurrentContainerClosed: boolean = Boolean(