🐛(frontend) change saving behavior firefox

Firefox does not trigger the request everytime the
user leaves the page. Plus the request is not
intercepted by the service worker.
So we prevent the default behavior to have
the popup asking the user if he wants to leave the
page, by adding the popup, we let the time to the
request to be sent, and intercepted by the
service worker (for the offline part).

We also add a toast to inform the user that the
document has been saved, it will make it more obvious
that the document has been saved if a firefox user
come back from the popup to the page.
This commit is contained in:
Anthony LC
2024-06-25 15:49:46 +02:00
committed by Anthony LC
parent 08a39c7ebd
commit d588ae847f
2 changed files with 48 additions and 12 deletions

View File

@@ -132,6 +132,10 @@ test.describe('Doc Editor', () => {
})
.click();
await expect(
page.getByText(`Your document "${doc}" has been saved.`),
).toBeVisible();
const card = page.getByLabel('Create new document card').first();
await expect(
card.getByRole('heading', {