plane/web/pages/[workspaceSlug]/projects/[projectId]
João Lucas de Oliveira Lopes a1d6c40627
fix: show window closing alert only when page is not saved (#3577)
* fix: show window closing alert only when page is not saved

* chore: Refactor useReloadConfirmations hook

- Removed the `message` parameter, as it was not being used and not
  supported in modern browsers
- Changed the `isActive` flag to a temporary flag and added a TODO comment to remove it later.
- Implemented the `handleRouteChangeStart` function to handle route change events and prompt the user with a confirmation dialog before leaving the page.
- Updated the dependencies of the `handleBeforeUnload` and `handleRouteChangeStart` callbacks.
- Added event listeners for `beforeunload` and `routeChangeStart` events in the `useEffect` hook.
- Cleaned up the event listeners in the cleanup function of the `useEffect` hook.

fix: Fix reload confirmations in PageDetailsPage

- Removed the TODO comment regarding fixing reload confirmations with MobX, as it has been resolved.
- Passed the `pageStore?.isSubmitting === "submitting"` flag to the `useReloadConfirmations` hook instead of an undefined message.

This commit refactors the `useReloadConfirmations` hook to improve its functionality and fixes the usage in the `PageDetailsPage` component.

---------

Co-authored-by: Palanikannan1437 <73993394+Palanikannan1437@users.noreply.github.com>
2024-02-07 17:10:44 +05:30
..
archived-issues chore: archived issues restructure. (#3469) 2024-01-25 18:09:01 +05:30
cycles style: responsive breadcrumbs and headers for dashboard, projects, project issues, cycles, cycle issues, module issues (#3580) 2024-02-07 13:44:03 +05:30
draft-issues refactor: MobX store structure (#3228) 2024-01-02 18:12:55 +05:30
inbox fix: inbox issue bug fixes and improvements. (#3460) 2024-01-25 13:41:02 +05:30
issues chore: archived issues restructure. (#3469) 2024-01-25 18:09:01 +05:30
modules chore: refactored and resolved build issues on the issues and issue detail page (#3340) 2024-01-22 13:19:43 +05:30
pages fix: show window closing alert only when page is not saved (#3577) 2024-02-07 17:10:44 +05:30
settings chore: UI/UX improvements (#3319) 2024-01-22 13:19:43 +05:30
views refactor: MobX store structure (#3228) 2024-01-02 18:12:55 +05:30