Skip to content

Commit 2335959

Browse files
committed
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.
1 parent 4240da8 commit 2335959

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/js/simplemde.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -871,7 +871,7 @@ SimpleMDE.prototype.autosave = function() {
871871
}
872872

873873
if(this.options.autosave.loaded !== true) {
874-
if(localStorage.getItem(this.options.autosave.unique_id) != null)
874+
if(typeof localStorage.getItem(this.options.autosave.unique_id) == "string" && localStorage.getItem(this.options.autosave.unique_id) != "")
875875
this.codemirror.setValue(localStorage.getItem(this.options.autosave.unique_id));
876876

877877
this.options.autosave.loaded = true;

0 commit comments

Comments
 (0)