From ef443a99eea066c644922ea66e5d01ab1ca66743 Mon Sep 17 00:00:00 2001 From: Sam Rose Date: Wed, 12 Apr 2017 08:31:56 -0400 Subject: Update ResolveBtn when CommentStore changes state --- app/assets/javascripts/diff_notes/components/resolve_btn.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/assets/javascripts/diff_notes/components/resolve_btn.js b/app/assets/javascripts/diff_notes/components/resolve_btn.js index 312f38ce241..dcfc40c1013 100644 --- a/app/assets/javascripts/diff_notes/components/resolve_btn.js +++ b/app/assets/javascripts/diff_notes/components/resolve_btn.js @@ -20,8 +20,7 @@ import Vue from 'vue'; data: function () { return { discussions: CommentsStore.state, - loading: false, - note: {}, + loading: false }; }, watch: { @@ -34,6 +33,9 @@ import Vue from 'vue'; discussion: function () { return this.discussions[this.discussionId]; }, + note: function () { + return this.discussion ? this.discussion.getNote(this.noteId) : {}; + }, buttonText: function () { if (this.isResolved) { return `Resolved by ${this.resolvedByName}`; @@ -112,8 +114,6 @@ import Vue from 'vue'; authorAvatar: this.authorAvatar, noteTruncated: this.noteTruncated, }); - - this.note = this.discussion.getNote(this.noteId); } }); -- cgit v1.2.1