Skip to content
This repository has been archived by the owner on Dec 16, 2021. It is now read-only.

Alert if repl hasn't been saved #117

Closed
lwkchan opened this issue May 29, 2020 · 4 comments · Fixed by sveltejs/svelte#6153 or #156
Closed

Alert if repl hasn't been saved #117

lwkchan opened this issue May 29, 2020 · 4 comments · Fixed by sveltejs/svelte#6153 or #156

Comments

@lwkchan
Copy link

lwkchan commented May 29, 2020

This is a feature request

I have a habit of closing tabs or windows by mistake and losing work, and others probably do too. It would be awesome if when the user closes the tab or leaves the page, that an alert is shown warning that the repl has not been saved. Perhaps a message like

Warning: this repl has not been saved and leaving will lose the most recent changes since last saving

If the user closes the message, immediately presses save, then leaves the page without making any other changes. Then this message won't be shown.

Happy to write the code and make a PR if this feature sounds like a good idea?

@irshadshalu
Copy link

Just came here to report this. Just lost 30 minutes worth of work because I hit a Ctrl + R for Ctrl + T

@vrde
Copy link

vrde commented Jul 4, 2020

Same here, I just lost quite some work because I accidentally hit the browser back button 😞.

@geoffrich
Copy link
Member

I'd love to see this too. I believe CodePen does something similar.

@joshnuss
Copy link
Contributor

Hi, I've put together a fix for this issue:

PRs

Demo

repl-demo.mp4

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
5 participants