Skip to content
Snippets Groups Projects
Commit bb19692b authored by Martin Schoeler's avatar Martin Schoeler
Browse files

fix reviews

parent 4bb01210
No related merge requests found
......@@ -32,10 +32,9 @@ Template.mentionsFlexTab.onCreated(function() {
this.hasMore = new ReactiveVar(true);
this.limit = new ReactiveVar(50);
return this.autorun(() => {
return this.subscribe('mentionedMessages', this.data.rid, this.limit.get(), function() {
if (MentionedMessage.find({
rid: this.data.rid
}).count() < this.limit.get()) {
const mentionedMessageFind = MentionedMessage.find({ rid: this.data.rid });
return this.subscribe('mentionedMessages', this.data.rid, this.limit.get(), () => {
if (mentionedMessageFind.count() < this.limit.get()) {
return this.hasMore.set(false);
}
});
......
......@@ -9,7 +9,6 @@ Package.onUse(function(api) {
api.use([
'mongo',
'ecmascript',
'coffeescript',
'underscore',
'less',
'rocketchat:lib'
......
Meteor.publish('mentionedMessages', function(rid, limit) {
if (limit == null) {
limit = 50;
}
Meteor.publish('mentionedMessages', function(rid, limit = 50) {
if (!this.userId) {
return this.ready();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment