Open laurentC35 opened 3 hours ago
We can use this hook: https://react-hooked.vercel.app/docs/useBeforeUnload
Currently, the user can potentially lose some data if they quit their page since the save is only done on manual disconnect, navigating through internal links and clicking next or previous inside the orchestrator.
If they close their navigator or tab no data can have been saved since a while, which can be annoying to the user. They can also lose data if their computer suddenly shuts down.
We can either ask the user if they truly want to close the tab since they can lose data (which cover the first case) and/or save the data from time to time when we see the data has been changed and has not been saved in a while (which cover the second case).
Un peu lié à https://github.com/InseeFr/stromae-dsfr/issues/149, techniquement voir ce qui est possible de faire