Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/assets/javascripts/diff_notes/components/comment_resolve_btn.js')
-rw-r--r--app/assets/javascripts/diff_notes/components/comment_resolve_btn.js21
1 files changed, 6 insertions, 15 deletions
diff --git a/app/assets/javascripts/diff_notes/components/comment_resolve_btn.js b/app/assets/javascripts/diff_notes/components/comment_resolve_btn.js
index 84e07598fed..dd60e2c7684 100644
--- a/app/assets/javascripts/diff_notes/components/comment_resolve_btn.js
+++ b/app/assets/javascripts/diff_notes/components/comment_resolve_btn.js
@@ -1,4 +1,3 @@
-/* eslint-disable no-else-return, no-lonely-if */
/* global CommentsStore */
import $ from 'jquery';
@@ -22,27 +21,19 @@ const CommentAndResolveBtn = Vue.extend({
showButton() {
if (this.discussion) {
return this.discussion.isResolvable();
- } else {
- return false;
}
+ return false;
},
isDiscussionResolved() {
return this.discussion.isResolved();
},
buttonText() {
- if (this.isDiscussionResolved) {
- if (this.textareaIsEmpty) {
- return __('Unresolve thread');
- } else {
- return __('Comment & unresolve thread');
- }
- } else {
- if (this.textareaIsEmpty) {
- return __('Resolve thread');
- } else {
- return __('Comment & resolve thread');
- }
+ if (this.textareaIsEmpty) {
+ return this.isDiscussionResolved ? __('Unresolve thread') : __('Resolve thread');
}
+ return this.isDiscussionResolved
+ ? __('Comment & unresolve thread')
+ : __('Comment & resolve thread');
},
},
created() {