Skip to content

A platform for community discussion. Free, open, simple.

DEV: Check lifecycle props in Presence service (#27328)

Jarek Radoszbbdf14828b5b
diff --git a/app/assets/javascripts/discourse/app/services/presence.js b/app/assets/javascripts/discourse/app/services/presence.js
index 90884ce1a35..9bbcf04694a 100644
--- a/app/assets/javascripts/discourse/app/services/presence.js
+++ b/app/assets/javascripts/discourse/app/services/presence.js
@@ -595,6 +595,10 @@ export default class PresenceService extends Service {
// drop back to the last event via the regular throttle function.
@bind
_throttledUpdateServer() {
+ if (this.isDestroying || this.isDestroyed) {
+ return;
+ }
+
if (
!this._lastUpdate ||
new Date() - this._lastUpdate > PRESENCE_THROTTLE_MS