From 34cdecf347b018a5d9e5e74c35fa2a841d5718f3 Mon Sep 17 00:00:00 2001 From: Michael An <2331806369@qq.com> Date: Tue, 5 Mar 2019 13:50:12 +0800 Subject: [PATCH] username (#3038) --- frontend/src/markdown-editor.js | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/frontend/src/markdown-editor.js b/frontend/src/markdown-editor.js index 64752929a8..3c1d6e0093 100644 --- a/frontend/src/markdown-editor.js +++ b/frontend/src/markdown-editor.js @@ -27,7 +27,7 @@ class EditorUtilities { this.repoID = repoID; this.filePath = filePath; this.serviceUrl = serviceUrl; - this.name = userName; + this.name = userInfo.name; this.contact_email = userInfo.contact_email; this.fileName = fileName; this.userName = userName; @@ -304,10 +304,18 @@ class MarkdownEditor extends React.Component { switch(option) { case 'related_files': - this.setState({ - showRelatedFileDialog: true, - showMarkdownEditorDialog: true, - }); + if (this.state.relatedFiles.length > 0) { + this.setState({ + showRelatedFileDialog: true, + showMarkdownEditorDialog: true, + }); + } + else { + this.setState({ + showAddRelatedFileDialog: true, + showMarkdownEditorDialog: true, + }); + } break; case 'tags': this.setState({