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) {
941
941
// The codemirror component is only available after rendering
942
942
// so, the setter for the initialValue can only run after
943
943
// the element has been rendered
944
- if ( options . initialValue ) {
944
+ if ( options . initialValue && ( ! this . options . autosave || this . options . autosave . foundSavedValue !== true ) ) {
945
945
this . value ( options . initialValue ) ;
946
946
}
947
947
}
@@ -1081,8 +1081,10 @@ SimpleMDE.prototype.autosave = function() {
1081
1081
}
1082
1082
1083
1083
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 ) != "" ) {
1085
1085
this . codemirror . setValue ( localStorage . getItem ( "smde_" + this . options . autosave . uniqueId ) ) ;
1086
+ this . options . autosave . foundSavedValue = true ;
1087
+ }
1086
1088
1087
1089
this . options . autosave . loaded = true ;
1088
1090
}
You can’t perform that action at this time.
0 commit comments