FIX: do not refresh metadata of not followed channel (#20766)

This commit is contained in:
Joffrey JAFFEUX 2023-03-21 20:13:44 +01:00 committed by GitHub
parent d4c6511d31
commit b5c4e1b813
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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