diff options
Diffstat (limited to 'app/assets/javascripts/diffs/components/diff_line_note_form.vue')
-rw-r--r-- | app/assets/javascripts/diffs/components/diff_line_note_form.vue | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/app/assets/javascripts/diffs/components/diff_line_note_form.vue b/app/assets/javascripts/diffs/components/diff_line_note_form.vue index 5d9bd78a1a5..7ad34c3121d 100644 --- a/app/assets/javascripts/diffs/components/diff_line_note_form.vue +++ b/app/assets/javascripts/diffs/components/diff_line_note_form.vue @@ -54,10 +54,12 @@ export default { methods: { ...mapActions('diffs', ['cancelCommentForm']), ...mapActions(['saveNote', 'refetchDiscussionById']), - handleCancelCommentForm() { - // eslint-disable-next-line no-alert - if (!window.confirm('Are you sure you want to cancel creating this comment?')) { - return; + handleCancelCommentForm(shouldConfirm, isDirty) { + if (shouldConfirm && isDirty) { + // eslint-disable-next-line no-alert + if (!window.confirm('Are you sure you want to cancel creating this comment?')) { + return; + } } this.cancelCommentForm({ |