Skip to content

Commit

Permalink
Made close function optional in useResponseHandler (#83)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexShukel authored Jul 25, 2023
1 parent e06f248 commit 0d44341
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/hooks/useResponseHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export type ResponseHandler<R> = {
};

export const useResponseHandler = <R>(
close: () => void
close?: () => void
): ResponseHandler<R> => {
const {
getPopup,
Expand Down Expand Up @@ -57,7 +57,9 @@ export const useResponseHandler = <R>(
);
}

popup.setCloseHandler(close);
if (close) {
popup.setCloseHandler(close);
}
popupRef.current = popup;
}, [getPopup, popupIdentifier, close]);

Expand Down

0 comments on commit 0d44341

Please sign in to comment.