Skip to content

Commit

Permalink
fix: separate detected close errors to reject promise case
Browse files Browse the repository at this point in the history
  • Loading branch information
siddy2181 committed Jun 4, 2024
1 parent 0800be7 commit e36ed60
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
1 change: 0 additions & 1 deletion src/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -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",
};

Expand Down
2 changes: 1 addition & 1 deletion src/parent/parent.js
Original file line number Diff line number Diff line change
Expand Up @@ -884,7 +884,7 @@ export function parentComponent<P, X, C>({
.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(
Expand Down

0 comments on commit e36ed60

Please sign in to comment.