mirror of
https://github.com/sparksuite/simplemde-markdown-editor.git
synced 2024-06-13 19:32:30 +02:00
Fix autosave
After submit form with autosave we have emty string in local storage. We won't set empty string instead of default form content.
This commit is contained in:
parent
4240da87c0
commit
23359590df
|
@ -871,7 +871,7 @@ SimpleMDE.prototype.autosave = function() {
|
|||
}
|
||||
|
||||
if(this.options.autosave.loaded !== true) {
|
||||
if(localStorage.getItem(this.options.autosave.unique_id) != null)
|
||||
if(typeof localStorage.getItem(this.options.autosave.unique_id) == "string" && localStorage.getItem(this.options.autosave.unique_id) != "")
|
||||
this.codemirror.setValue(localStorage.getItem(this.options.autosave.unique_id));
|
||||
|
||||
this.options.autosave.loaded = true;
|
||||
|
|
Loading…
Reference in a new issue