Update ResolveBtn when CommentStore changes state

This commit is contained in:
Sam Rose 2017-04-12 08:31:56 -04:00
parent d7a527163b
commit ef443a99ee

View file

@ -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);
}
});