Skip to content

Commit

Permalink
release: v1.4.5
Browse files Browse the repository at this point in the history
release: v1.4.5
  • Loading branch information
kbsat authored Oct 20, 2022
2 parents 3e34454 + e094229 commit e22181d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion frontend/src/hooks/utils/usePreventGoBack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@ const usePreventGoBack = () => {
useEffect(() => {
const preventGoBack = () => {
if (confirm(MESSAGE.ESCAPE_NOW_PAGE)) {
window.location.replace(location.href);
return history.back();
}
history.pushState(null, '', location.href);
};
history.pushState(null, '', location.href);
window.addEventListener('popstate', preventGoBack);

return () => window.removeEventListener('popstate', preventGoBack);
Expand Down

0 comments on commit e22181d

Please sign in to comment.