From bd14f86a769d1c569ec3834e5c19238e15ef70a0 Mon Sep 17 00:00:00 2001 From: Guilherme Gazzo Date: Tue, 9 Apr 2019 00:29:36 -0300 Subject: [PATCH 1/3] test threads performance --- app/threads/client/flextab/thread.html | 4 +- app/threads/client/flextab/thread.js | 2 +- app/threads/client/flextab/threads.html | 51 +++++++++------- app/threads/client/flextab/threads.js | 36 ++++++----- app/ui-message/client/message.js | 81 ++++++++++++++++++++----- app/ui/client/views/app/room.js | 3 +- 6 files changed, 120 insertions(+), 57 deletions(-) diff --git a/app/threads/client/flextab/thread.html b/app/threads/client/flextab/thread.html index 863ebb2c6751..64d88d2c8735 100644 --- a/app/threads/client/flextab/thread.html +++ b/app/threads/client/flextab/thread.html @@ -14,9 +14,9 @@

{{_ 'Thread'}}
    {{# with messageContext}} - {{> nrr nrrargs 'message' msg=mainMessage room=room subscription=subscription settings=settings customClass="thread-message" templatePrefix='thread-' customClass="thread-main" u=u}} + {{> nrr nrrargs 'message' hideRoles=true msg=mainMessage room=room subscription=subscription settings=settings customClass="thread-message" templatePrefix='thread-' customClass="thread-main" u=u}} {{#each msg in messages}} - {{> nrr nrrargs 'message' msg=msg room=room subscription=subscription settings=settings templatePrefix='thread-' u=u}} + {{> nrr nrrargs 'message' hideRoles=true msg=msg room=room subscription=subscription settings=settings templatePrefix='thread-' u=u}} {{/each}} {{/with}}
diff --git a/app/threads/client/flextab/thread.js b/app/threads/client/flextab/thread.js index d8dbaf39500a..96f70d058cd3 100644 --- a/app/threads/client/flextab/thread.js +++ b/app/threads/client/flextab/thread.js @@ -95,7 +95,7 @@ Template.thread.onRendered(function() { const tmid = this.state.get('tmid'); this.threadsObserve && this.threadsObserve.stop(); - this.threadsObserve = Messages.find({ tmid }).observe({ + this.threadsObserve = Messages.find({ tmid, _updatedAt: { $gt: new Date() } }).observe({ added: ({ _id, ...message }) => { const { atBottom } = this; this.Threads.upsert({ _id }, message); diff --git a/app/threads/client/flextab/threads.html b/app/threads/client/flextab/threads.html index 812d43eadf5e..a8a457119a7e 100644 --- a/app/threads/client/flextab/threads.html +++ b/app/threads/client/flextab/threads.html @@ -1,30 +1,35 @@