Skip to content

Commit fee4ba2

Browse files
committed
remove unnecessary code
1 parent 87e5163 commit fee4ba2

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

src/components/Modal/index.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,7 @@ function Modal({fullscreen = true, onModalHide = () => {}, type, onModalShow = (
2323
const hideModal = () => {
2424
if ((window.history.state as WindowState)?.shouldGoBack && shouldHandleNavigationBack) {
2525
// Wait for history.back() to complete before calling onModalHide to prevent navigation race conditions
26-
const handleHistoryBack = () => {
27-
onModalHide();
28-
window.removeEventListener('popstate', handleHistoryBack);
29-
};
30-
window.addEventListener('popstate', handleHistoryBack, {once: true});
26+
window.addEventListener('popstate', onModalHide, {once: true});
3127
window.history.back();
3228
} else {
3329
onModalHide();

0 commit comments

Comments
 (0)