Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ feat: Refactor useReloadConfirmations hook
- Removed the `message` parameter, as it was not being used. - Changed the `isActive` flag to a temporary flag and added a TODO comment to remove it later. - Added a new import statement for `useRouter` from "next/router". - 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.
- Loading branch information