memcode icon indicating copy to clipboard operation
memcode copied to clipboard

Warn when cards have unsaved changes

Open iopq opened this issue 1 year ago • 3 comments

I have lost cards because I forgot to click "Save" since I immediately try to learn the cards after I enter them. Sometimes the very last card just gets lost because I didn't save it, and it's not obvious this happened since it's just not there

There's a way to prompt on unsaved changes, I'd like this to happen when cards are not saved

iopq avatar Sep 24 '22 17:09 iopq

To clarify: I want to add a beforeunload event listener when any card has been changed without being saved

iopq avatar Sep 25 '22 06:09 iopq

I agree we should add it.

beforeunload should save the html of the card in localStorage; and, when this course is reopened, we should offer the Restore the flashcard; Dismiss the flashcard buttons.

The PR is welcome!

lakesare avatar Oct 02 '22 17:10 lakesare