1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-15 23:00:57 +00:00

repair code bug

This commit is contained in:
杨顺强
2024-01-19 15:26:34 +08:00
parent dd5354a216
commit 5bcdf83b28

View File

@@ -470,6 +470,10 @@ class MarkdownEditor extends React.Component {
}); });
}; };
getFileName = (fileName) => {
return fileName.substring(0, fileName.lastIndexOf('.'));
};
render() { render() {
const { loading, editorMode, markdownContent, fileInfo, fileTagList } = this.state; const { loading, editorMode, markdownContent, fileInfo, fileTagList } = this.state;
@@ -504,7 +508,7 @@ class MarkdownEditor extends React.Component {
ref={this.editorRef} ref={this.editorRef}
mode={editorMode} mode={editorMode}
isFetching={loading} isFetching={loading}
initValue={fileName} initValue={this.getFileName(fileName)}
value={markdownContent} value={markdownContent}
editorApi={editorApi} editorApi={editorApi}
onSave={this.onSaveEditorContent} onSave={this.onSaveEditorContent}