Skip to content

Commit

Permalink
feat: textbooks page
Browse files Browse the repository at this point in the history
  • Loading branch information
vladislavkeblysh committed Mar 13, 2024
1 parent 0ef0f9a commit ba30003
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions src/generic/PromptIfDirty.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,7 @@ const PromptIfDirty = ({ dirty }) => {
// eslint-disable-next-line consistent-return
const handleBeforeUnload = (event) => {
if (dirty) {
const message = 'You have unsaved changes. Are you sure you want to leave?';
event.preventDefault();
// eslint-disable-next-line no-param-reassign
event.returnValue = message;

return message; // For older browsers
}
};
window.addEventListener('beforeunload', handleBeforeUnload);
Expand Down

0 comments on commit ba30003

Please sign in to comment.