diff --git a/plugins/chat/assets/javascripts/discourse/components/chat-channel-selector-modal-inner.js b/plugins/chat/assets/javascripts/discourse/components/chat-channel-selector-modal-inner.js index 86ac4fe5615..81ff741afe5 100644 --- a/plugins/chat/assets/javascripts/discourse/components/chat-channel-selector-modal-inner.js +++ b/plugins/chat/assets/javascripts/discourse/components/chat-channel-selector-modal-inner.js @@ -131,6 +131,10 @@ export default Component.extend({ @action fetchChannelsFromServer(filter) { + if (this.isDestroyed || this.isDestroying) { + return; + } + this.setProperties({ loading: true, searchIndex: this.searchIndex + 1, @@ -165,6 +169,10 @@ export default Component.extend({ @action getInitialChannels() { + if (this.isDestroyed || this.isDestroying) { + return; + } + const channels = this.getChannelsWithFilter(this.filter); this.set("channels", channels); this.focusFirstChannel(channels);