Skip to content

Commit

Permalink
fix starredMessages.js
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinSchoeler committed Apr 27, 2017
1 parent e91c9cd commit 08d059f
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions packages/rocketchat-message-star/client/views/starredMessages.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,14 @@ Template.starredMessages.helpers({
Template.starredMessages.onCreated(function() {
this.hasMore = new ReactiveVar(true);
this.limit = new ReactiveVar(50);
return this.autorun(() => {
return () => {
const sub = this.subscribe('starredMessages', this.data.rid, this.limit.get());
if (sub.ready()) {
if (StarredMessage.find({
rid: this.data.rid
}).count() < this.limit.get()) {
return this.hasMore.set(false);
}
this.autorun(() => {
const sub = this.subscribe('starredMessages', this.data.rid, this.limit.get());
const findStarredMessage = StarredMessage.find({ rid: this.data.rid });
if (sub.ready()) {
if (findStarredMessage.count() < this.limit.get()) {
return this.hasMore.set(false);
}
};
}
});
});

Expand Down

0 comments on commit 08d059f

Please sign in to comment.