plane/web
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
..
components chore: workspace dashboard refactor (#3584) 2024-02-07 16:21:20 +05:30
constants chore: added None filter option to the dashboard widgets (#3556) 2024-02-05 19:12:33 +05:30
contexts refactor: MobX store structure (#3228) 2024-01-02 18:12:55 +05:30
helpers chore: added None filter option to the dashboard widgets (#3556) 2024-02-05 19:12:33 +05:30
hooks fix: show window closing alert only when page is not saved (#3577) 2024-02-07 17:10:44 +05:30
layouts chore: posthog events improved (#3554) 2024-02-05 13:19:07 +05:30
lib chore: posthog events improved (#3554) 2024-02-05 13:19:07 +05:30
pages fix: show window closing alert only when page is not saved (#3577) 2024-02-07 17:10:44 +05:30
public chore: empty state and project active cycle improvement (#3472) 2024-01-25 18:00:45 +05:30
services chore: implemented multiple modules select in the issues (#3484) 2024-01-30 15:23:20 +05:30
store fix: draft issue peek overview (#3582) 2024-02-07 15:06:07 +05:30
styles feat: dashboard widgets (#3362) 2024-01-22 13:22:09 +05:30
.env.example chore: configurations (#3059) 2023-12-11 14:32:28 +05:30
.eslintrc.js chore: eslint config package fixes (#2165) 2023-09-13 12:06:17 +05:30
.prettierignore chore: format all files in monorepo (#3054) 2023-12-10 15:50:45 +05:30
.prettierrc fix: Implementing mobx, refactoring service layer and rewriting components (#2441) 2023-10-15 23:50:12 +05:30
Dockerfile.dev fix: environment file missing for space (#3105) 2023-12-14 16:18:02 +05:30
Dockerfile.web fixes web container public assets (#3336) 2024-01-22 13:19:43 +05:30
google.d.ts New Directory Setup (#2065) 2023-09-03 18:50:30 +05:30
manifest.json New Directory Setup (#2065) 2023-09-03 18:50:30 +05:30
next-env.d.ts New Directory Setup (#2065) 2023-09-03 18:50:30 +05:30
next.config.js fix: adding additional headers to restrict iframe 2023-12-20 13:49:17 +05:30
package.json chore: updating package json version (#3443) 2024-01-23 16:37:51 +05:30
postcss.config.js feat: Editor Core Packaging and Restructuring (#2358) 2023-10-13 12:05:49 +05:30
sentry.client.config.js New Directory Setup (#2065) 2023-09-03 18:50:30 +05:30
sentry.edge.config.js New Directory Setup (#2065) 2023-09-03 18:50:30 +05:30
sentry.properties New Directory Setup (#2065) 2023-09-03 18:50:30 +05:30
sentry.server.config.js New Directory Setup (#2065) 2023-09-03 18:50:30 +05:30
tailwind.config.js feat: Editor Core Packaging and Restructuring (#2358) 2023-10-13 12:05:49 +05:30
tsconfig.json refactor: MobX store structure (#3228) 2024-01-02 18:12:55 +05:30