From a5fbc7251d2aaeec23b2e73c85f81eca26ed6c7f Mon Sep 17 00:00:00 2001 From: Diego Sampaio Date: Fri, 14 Dec 2018 16:58:01 -0200 Subject: [PATCH] Fix spotlight being called while in background --- .../rocketchat-ui-message/client/popup/messagePopup.js | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/packages/rocketchat-ui-message/client/popup/messagePopup.js b/packages/rocketchat-ui-message/client/popup/messagePopup.js index c750775be5a1..27f89fadc0fc 100644 --- a/packages/rocketchat-ui-message/client/popup/messagePopup.js +++ b/packages/rocketchat-ui-message/client/popup/messagePopup.js @@ -4,7 +4,6 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; -import { Tracker } from 'meteor/tracker'; import { Template } from 'meteor/templating'; import _ from 'underscore'; import { lazyloadtick } from 'meteor/rocketchat:lazy-load'; @@ -218,10 +217,7 @@ Template.messagePopup.onCreated(function() { return setCursorPosition(template.input, firstPartValue.length); }; template.records = new ReactiveVar([]); - Tracker.autorun(function() { - if (template.data.collection.findOne != null) { - template.data.collection.find().count(); - } + template.autorun(function() { const filter = template.textFilter.get(); if (filter != null) { const filterCallback = (result) => { @@ -268,14 +264,14 @@ Template.messagePopup.onRendered(function() { $(this.input).on('keyup', this.onInputKeyup.bind(this)); $(this.input).on('keydown', this.onInputKeydown.bind(this)); $(this.input).on('focus', this.onFocus.bind(this)); - return $(this.input).on('blur', this.onBlur.bind(this)); + $(this.input).on('blur', this.onBlur.bind(this)); }); Template.messagePopup.onDestroyed(function() { $(this.input).off('keyup', this.onInputKeyup); $(this.input).off('keydown', this.onInputKeydown); $(this.input).off('focus', this.onFocus); - return $(this.input).off('blur', this.onBlur); + $(this.input).off('blur', this.onBlur); }); Template.messagePopup.events({