19lmyers/cse110-w21-group14

Implement page warning confirmation

j1sun opened this issue · 1 comments

j1sun commented

Implement a warning right before the user closes the window (eg. Are you sure you want to leave this page?) so that the user doesn't accidentally close the tab unexpectedly.

There's likely a way to alert or ask for confirmation from the user in the same style as alert() (don't make new HTML elements, just use what's built-in to JS).

j1sun commented

One interesting way to implement this is on top of localStorage instead of giving a warning every time: Either save the current state of the timer to local storage when the window is closed and resume when they get back, or assume leaving means quitting the pomodoro early and thus doesn't count.