[FIX] star icon was visible after unstarring a message (#19645)

Co-authored-by: Diego Sampaio <chinello@gmail.com>
Co-authored-by: Martin Schoeler <martin.schoeler@rocket.chat>
pull/20799/head
Bhavay Anand 4 years ago committed by GitHub
parent 8068674b6e
commit bdcf3bf038
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      app/ui-message/client/message.js

@ -1,4 +1,5 @@
import _ from 'underscore';
import { Meteor } from 'meteor/meteor';
import { Tracker } from 'meteor/tracker';
import { Template } from 'meteor/templating';
import { Session } from 'meteor/session';
@ -451,7 +452,7 @@ Template.message.helpers({
},
showStar() {
const { msg } = this;
return msg.starred && !(msg.actionContext === 'starred' || this.context === 'starred');
return msg.starred && msg.starred.length > 0 && msg.starred.find((star) => star._id === Meteor.userId()) && !(msg.actionContext === 'starred' || this.context === 'starred');
},
});

Loading…
Cancel
Save