fix reviews

pull/6689/head
Martin Schoeler 9 years ago
parent 4bb01210d9
commit bb19692bcc
  1. 7
      packages/rocketchat-mentions-flextab/client/views/mentionsFlexTab.js
  2. 1
      packages/rocketchat-mentions-flextab/package.js
  3. 5
      packages/rocketchat-mentions-flextab/server/publications/mentionedMessages.js

@ -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'

@ -1,7 +1,4 @@
Meteor.publish('mentionedMessages', function(rid, limit) {
if (limit == null) {
limit = 50;
}
Meteor.publish('mentionedMessages', function(rid, limit = 50) {
if (!this.userId) {
return this.ready();
}

Loading…
Cancel
Save