mirror of
https://github.com/haiwen/seahub.git
synced 2025-07-17 00:32:37 +00:00
fix auto save draft (#3279)
This commit is contained in:
parent
01c509f724
commit
2ec5c855e1
@ -26,6 +26,7 @@ const propTypes = {
|
|||||||
readOnly: PropTypes.bool.isRequired,
|
readOnly: PropTypes.bool.isRequired,
|
||||||
contentChanged: PropTypes.bool.isRequired,
|
contentChanged: PropTypes.bool.isRequired,
|
||||||
saving: PropTypes.bool.isRequired,
|
saving: PropTypes.bool.isRequired,
|
||||||
|
showDraftSaved: PropTypes.bool.isRequired,
|
||||||
};
|
};
|
||||||
|
|
||||||
const MoreMenuPropTypes = {
|
const MoreMenuPropTypes = {
|
||||||
@ -92,8 +93,12 @@ class MarkdownViewerToolbar extends React.Component {
|
|||||||
return (
|
return (
|
||||||
<div className="sf-md-viewer-topbar">
|
<div className="sf-md-viewer-topbar">
|
||||||
<div className="sf-md-viewer-topbar-first d-flex justify-content-between">
|
<div className="sf-md-viewer-topbar-first d-flex justify-content-between">
|
||||||
<FileInfo toggleStar={this.props.toggleStar} editorUtilities={this.props.editorUtilities}
|
<FileInfo
|
||||||
fileInfo={this.props.fileInfo}/>
|
toggleStar={this.props.toggleStar}
|
||||||
|
editorUtilities={this.props.editorUtilities}
|
||||||
|
fileInfo={this.props.fileInfo}
|
||||||
|
showDraftSaved={this.props.showDraftSaved}
|
||||||
|
/>
|
||||||
{(this.props.hasDraft && !this.props.isDraft) &&
|
{(this.props.hasDraft && !this.props.isDraft) &&
|
||||||
<div className='seafile-btn-view-review'>
|
<div className='seafile-btn-view-review'>
|
||||||
<div className='tag tag-green'>{gettext('This file is in draft stage.')}
|
<div className='tag tag-green'>{gettext('This file is in draft stage.')}
|
||||||
|
@ -430,10 +430,9 @@ class MarkdownEditor extends React.Component {
|
|||||||
localDraftDialog: false,
|
localDraftDialog: false,
|
||||||
loading: false,
|
loading: false,
|
||||||
});
|
});
|
||||||
} else {
|
|
||||||
let draftKey = editorUtilities.getDraftKey();
|
|
||||||
localStorage.removeItem(draftKey);
|
|
||||||
}
|
}
|
||||||
|
let draftKey = editorUtilities.getDraftKey();
|
||||||
|
localStorage.removeItem(draftKey);
|
||||||
}
|
}
|
||||||
|
|
||||||
closeDraftDialog = () => {
|
closeDraftDialog = () => {
|
||||||
@ -714,6 +713,7 @@ class MarkdownEditor extends React.Component {
|
|||||||
editorMode={this.state.editorMode}
|
editorMode={this.state.editorMode}
|
||||||
contentChanged={this.state.contentChanged}
|
contentChanged={this.state.contentChanged}
|
||||||
saving={this.state.saving}
|
saving={this.state.saving}
|
||||||
|
showDraftSaved={this.state.showDraftSaved}
|
||||||
/>
|
/>
|
||||||
<SeafileEditor
|
<SeafileEditor
|
||||||
fileInfo={this.state.fileInfo}
|
fileInfo={this.state.fileInfo}
|
||||||
@ -737,7 +737,6 @@ class MarkdownEditor extends React.Component {
|
|||||||
clearTimer={this.clearTimer}
|
clearTimer={this.clearTimer}
|
||||||
openDialogs={this.openDialogs}
|
openDialogs={this.openDialogs}
|
||||||
deleteDraft={this.deleteDraft}
|
deleteDraft={this.deleteDraft}
|
||||||
showDraftSaved={this.state.showDraftSaved}
|
|
||||||
readOnly={this.state.readOnly}
|
readOnly={this.state.readOnly}
|
||||||
onContentChanged={this.onContentChanged}
|
onContentChanged={this.onContentChanged}
|
||||||
onSaving={this.onSaving}
|
onSaving={this.onSaving}
|
||||||
|
Loading…
Reference in New Issue
Block a user