mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: prevent chat channel not found ajax error (#28818)
On occasion we get an error popup on desktop due to the channel not being found. This change means that we only check the cached channels in ChatChannelsManager for the matching channel id, but we skip doing manual lookup which results in ajax popup when it fails.
This commit is contained in:
@@ -148,7 +148,9 @@ export default class ChatNotificationManager extends Service {
|
||||
|
||||
@action
|
||||
async fetchChannel(channelId) {
|
||||
return await this.chatChannelsManager.find(channelId);
|
||||
return await this.chatChannelsManager.find(channelId, {
|
||||
fetchIfNotFound: false,
|
||||
});
|
||||
}
|
||||
|
||||
@bind
|
||||
@@ -159,7 +161,10 @@ export default class ChatNotificationManager extends Service {
|
||||
|
||||
if (this.site.desktopView) {
|
||||
const channel = await this.fetchChannel(data.channel_id);
|
||||
|
||||
if (channel) {
|
||||
data.isDirectMessageChannel = channel.isDirectMessageChannel ?? false;
|
||||
}
|
||||
|
||||
return onDesktopNotification(
|
||||
data,
|
||||
|
||||
Reference in New Issue
Block a user