plane/web/pages
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
..
[workspaceSlug] fix: show window closing alert only when page is not saved (#3577) 2024-02-07 17:10:44 +05:30
accounts improvement: add hide/ unhide icon for all password field in the platform. (#3513) 2024-01-30 20:11:16 +05:30
god-mode refactor: MobX store structure (#3228) 2024-01-02 18:12:55 +05:30
installations/[provider] refactor: MobX store structure (#3228) 2024-01-02 18:12:55 +05:30
invitations chore: posthog events improved (#3554) 2024-02-05 13:19:07 +05:30
onboarding chore: posthog events improved (#3554) 2024-02-05 13:19:07 +05:30
profile chore: enhance loading state for setting page updates (#3533) 2024-02-01 13:35:01 +05:30
workspace-invitations fix: breaking cycle issues and replacing router.push with Links (#3330) 2024-01-22 13:19:43 +05:30
_app.tsx refactor: MobX store structure (#3228) 2024-01-02 18:12:55 +05:30
_document.tsx fix: project states fixes (#2731) 2023-11-08 20:31:46 +05:30
_error.tsx chore: format all files in monorepo (#3054) 2023-12-10 15:48:10 +05:30
404.tsx fix: removed unused packages and upgraded to next 14 (#2944) 2023-12-07 19:59:35 +05:30
create-workspace.tsx fix: breaking cycle issues and replacing router.push with Links (#3330) 2024-01-22 13:19:43 +05:30
index.tsx refactor: MobX store structure (#3228) 2024-01-02 18:12:55 +05:30