diff --git a/plugins/discourse-presence/assets/javascripts/discourse/components/topic-presence-display.js.es6 b/plugins/discourse-presence/assets/javascripts/discourse/components/topic-presence-display.js.es6 index 9cfb46f7ba1..1f8ec4d27a3 100644 --- a/plugins/discourse-presence/assets/javascripts/discourse/components/topic-presence-display.js.es6 +++ b/plugins/discourse-presence/assets/javascripts/discourse/components/topic-presence-display.js.es6 @@ -11,11 +11,11 @@ export default Component.extend({ @on("didInsertElement") subscribe() { - this.get("presenceManager").subscribe(); + this.presenceManager && this.presenceManager.subscribe(); }, @on("willDestroyElement") _destroyed() { - this.get("presenceManager").unsubscribe(); + this.presenceManager && this.presenceManager.unsubscribe(); } }); diff --git a/plugins/discourse-presence/assets/javascripts/initializers/discourse-presence.js.es6 b/plugins/discourse-presence/assets/javascripts/initializers/discourse-presence.js.es6 index 1b591ce4d13..f1558d05780 100644 --- a/plugins/discourse-presence/assets/javascripts/initializers/discourse-presence.js.es6 +++ b/plugins/discourse-presence/assets/javascripts/initializers/discourse-presence.js.es6 @@ -35,7 +35,7 @@ export default { initialize(container) { const siteSettings = container.lookup("site-settings:main"); - if (siteSettings.presence_enabled) { + if (siteSettings.presence_enabled && ENV.environment !== "test") { withPluginApi("0.8.40", initializeDiscoursePresence); } }