提交 ebf7d52d 编写于 作者: F Fatih Acet

IssueNotesRefactor: Hide note reply form when submitted and show it again if there is an error.

上级 aa3ff56c
......@@ -110,7 +110,7 @@
this.resetAutoSave();
this.isReplying = false;
},
saveReply(noteText) {
saveReply(noteText, form, callback) {
const replyData = {
endpoint: this.newNotePath,
flashContainer: this.$el,
......@@ -121,20 +121,22 @@
note: { note: noteText },
},
};
this.isReplying = false;
this.saveNote(replyData)
.then(() => {
this.isReplying = false;
this.resetAutoSave();
callback();
})
.catch(() => {
Flash(
'Your comment could not be submitted! Please check your network connection and try again.',
'alert',
$(this.$el),
);
.catch((err) => {
this.removePlaceholderNotes();
this.$refs.noteForm.isSubmitting = false;
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);
});
});
},
},
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册