2
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2025-09-04 08:47:37 +08:00

FIX: Only unsubscribe channel if it was subscribed.

This commit is contained in:
Guo Xiang Tan 2018-03-06 21:37:38 +08:00
parent e09a4a353e
commit 8f5349eaa1

View file

@ -31,7 +31,8 @@ export default Ember.Controller.extend({
}, },
unsubscribe() { unsubscribe() {
this.messageBus.unsubscribe(this.get('channel')); const channel = this.get('channel');
if (channel) this.messageBus.unsubscribe(channel);
this._resetTracking(); this._resetTracking();
this.set('channel', null); this.set('channel', null);
}, },