1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-11-14 18:59:33 +00:00

fix auto save draft (#3279)

This commit is contained in:
Michael An
2019-04-15 12:09:58 +08:00
committed by Daniel Pan
parent 01c509f724
commit 2ec5c855e1
2 changed files with 10 additions and 6 deletions

View File

@@ -430,10 +430,9 @@ class MarkdownEditor extends React.Component {
localDraftDialog: false,
loading: false,
});
} else {
let draftKey = editorUtilities.getDraftKey();
localStorage.removeItem(draftKey);
}
let draftKey = editorUtilities.getDraftKey();
localStorage.removeItem(draftKey);
}
closeDraftDialog = () => {
@@ -714,6 +713,7 @@ class MarkdownEditor extends React.Component {
editorMode={this.state.editorMode}
contentChanged={this.state.contentChanged}
saving={this.state.saving}
showDraftSaved={this.state.showDraftSaved}
/>
<SeafileEditor
fileInfo={this.state.fileInfo}
@@ -737,7 +737,6 @@ class MarkdownEditor extends React.Component {
clearTimer={this.clearTimer}
openDialogs={this.openDialogs}
deleteDraft={this.deleteDraft}
showDraftSaved={this.state.showDraftSaved}
readOnly={this.state.readOnly}
onContentChanged={this.onContentChanged}
onSaving={this.onSaving}