summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/notes/components
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-12-13 00:08:05 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2019-12-13 00:08:05 +0000
commit47b8f79a0896f406008d5a7eda2781f8da301e91 (patch)
tree1f15328719ca1215a2bd0ec6650ece0ca59de3f4 /app/assets/javascripts/notes/components
parent52fe64b740a4ddbd5b085386dfe40fea191174ea (diff)
downloadgitlab-ce-47b8f79a0896f406008d5a7eda2781f8da301e91.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/notes/components')
-rw-r--r--app/assets/javascripts/notes/components/comment_form.vue17
-rw-r--r--app/assets/javascripts/notes/components/noteable_discussion.vue23
2 files changed, 13 insertions, 27 deletions
diff --git a/app/assets/javascripts/notes/components/comment_form.vue b/app/assets/javascripts/notes/components/comment_form.vue
index fda494fec07..492d8de3802 100644
--- a/app/assets/javascripts/notes/components/comment_form.vue
+++ b/app/assets/javascripts/notes/components/comment_form.vue
@@ -193,23 +193,10 @@ export default {
this.stopPolling();
this.saveNote(noteData)
- .then(res => {
+ .then(() => {
this.enableButton();
this.restartPolling();
-
- if (res.errors) {
- if (res.errors.commands_only) {
- this.discard();
- } else {
- Flash(
- __('Something went wrong while adding your comment. Please try again.'),
- 'alert',
- this.$refs.commentForm,
- );
- }
- } else {
- this.discard();
- }
+ this.discard();
if (withIssueAction) {
this.toggleIssueState();
diff --git a/app/assets/javascripts/notes/components/noteable_discussion.vue b/app/assets/javascripts/notes/components/noteable_discussion.vue
index 0151a3f10a5..1f31720ff40 100644
--- a/app/assets/javascripts/notes/components/noteable_discussion.vue
+++ b/app/assets/javascripts/notes/components/noteable_discussion.vue
@@ -198,23 +198,22 @@ export default {
data: postData,
};
- this.isReplying = false;
this.saveNote(replyData)
- .then(() => {
- clearDraft(this.autosaveKey);
+ .then(res => {
+ if (res.hasFlash !== true) {
+ this.isReplying = false;
+ clearDraft(this.autosaveKey);
+ }
callback();
})
.catch(err => {
this.removePlaceholderNotes();
- this.isReplying = true;
- this.$nextTick(() => {
- const msg = __(
- 'Your comment could not be submitted! Please check your network connection and try again.',
- );
- Flash(msg, 'alert', this.$el);
- this.$refs.noteForm.note = noteText;
- callback(err);
- });
+ const msg = __(
+ 'Your comment could not be submitted! Please check your network connection and try again.',
+ );
+ Flash(msg, 'alert', this.$el);
+ this.$refs.noteForm.note = noteText;
+ callback(err);
});
},
jumpToNextDiscussion() {