File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -941,7 +941,7 @@ function SimpleMDE(options) {
941941 // The codemirror component is only available after rendering
942942 // so, the setter for the initialValue can only run after
943943 // the element has been rendered
944- if ( options . initialValue ) {
944+ if ( options . initialValue && ( ! this . options . autosave || this . options . autosave . foundSavedValue !== true ) ) {
945945 this . value ( options . initialValue ) ;
946946 }
947947}
@@ -1081,8 +1081,10 @@ SimpleMDE.prototype.autosave = function() {
10811081 }
10821082
10831083 if ( this . options . autosave . loaded !== true ) {
1084- if ( typeof localStorage . getItem ( "smde_" + this . options . autosave . uniqueId ) == "string" && localStorage . getItem ( "smde_" + this . options . autosave . uniqueId ) != "" )
1084+ if ( typeof localStorage . getItem ( "smde_" + this . options . autosave . uniqueId ) == "string" && localStorage . getItem ( "smde_" + this . options . autosave . uniqueId ) != "" ) {
10851085 this . codemirror . setValue ( localStorage . getItem ( "smde_" + this . options . autosave . uniqueId ) ) ;
1086+ this . options . autosave . foundSavedValue = true ;
1087+ }
10861088
10871089 this . options . autosave . loaded = true ;
10881090 }
You can’t perform that action at this time.
0 commit comments