From b5c4e1b813d7691a3ca47056389665174c07b851 Mon Sep 17 00:00:00 2001 From: Joffrey JAFFEUX Date: Tue, 21 Mar 2023 20:13:44 +0100 Subject: [PATCH] FIX: do not refresh metadata of not followed channel (#20766) --- .../services/chat-subscriptions-manager.js | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/plugins/chat/assets/javascripts/discourse/services/chat-subscriptions-manager.js b/plugins/chat/assets/javascripts/discourse/services/chat-subscriptions-manager.js index 8430d083746..c8979c903e4 100644 --- a/plugins/chat/assets/javascripts/discourse/services/chat-subscriptions-manager.js +++ b/plugins/chat/assets/javascripts/discourse/services/chat-subscriptions-manager.js @@ -270,14 +270,16 @@ export default class ChatSubscriptionsManager extends Service { @bind _onChannelMetadata(busData) { - this.chatChannelsManager.find(busData.chat_channel_id).then((channel) => { - if (channel) { - channel.setProperties({ - memberships_count: busData.memberships_count, - }); - this.appEvents.trigger("chat:refresh-channel-members"); - } - }); + this.chatChannelsManager + .find(busData.chat_channel_id, { fetchIfNotFound: false }) + .then((channel) => { + if (channel) { + channel.setProperties({ + memberships_count: busData.memberships_count, + }); + this.appEvents.trigger("chat:refresh-channel-members"); + } + }); } @bind