in rich text editing, after the user has edited the content, the user"s data needs to be saved from time to time, using localStorage to save it locally on the client side.
if the user stays on the current editing page, the data is automatically saved every 5 seconds, overwriting and saving with the data in the current editor. If the user accidentally refreshes the page, it will automatically take out the data of the current page just saved and render it to the editor.
however, if the user opens a new editing page, or if the user exits and opens a new editing page, and the user enters the content, you need to create a new draft data in the draft box and then overwrite the update. You can"t overwrite updates directly on previous drafts.
the question is, how do you tell if the user refreshes the edit page or opens a new edit page, whether to create a new draft data or to update it on the existing draft data?