From ec53b0230f8d75005c5eb2593837623b127f5800 Mon Sep 17 00:00:00 2001 From: sunnie <78964224+sunnniee@users.noreply.github.com> Date: Tue, 6 Feb 2024 18:12:26 +0200 Subject: [PATCH] readAllNotificationsButton: also mark voice channels as read (#2140) --- .../readAllNotificationsButton/index.tsx | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/plugins/readAllNotificationsButton/index.tsx b/src/plugins/readAllNotificationsButton/index.tsx index b5b0b5f82..0e08edb6d 100644 --- a/src/plugins/readAllNotificationsButton/index.tsx +++ b/src/plugins/readAllNotificationsButton/index.tsx @@ -25,16 +25,17 @@ function onClick() { const channels: Array = []; Object.values(GuildStore.getGuilds()).forEach(guild => { - GuildChannelStore.getChannels(guild.id).SELECTABLE.forEach((c: { channel: { id: string; }; }) => { - if (!ReadStateStore.hasUnread(c.channel.id)) return; + GuildChannelStore.getChannels(guild.id).SELECTABLE + .concat(GuildChannelStore.getChannels(guild.id).VOCAL) + .forEach((c: { channel: { id: string; }; }) => { + if (!ReadStateStore.hasUnread(c.channel.id)) return; - channels.push({ - channelId: c.channel.id, - // messageId: c.channel?.lastMessageId, - messageId: ReadStateStore.lastMessageId(c.channel.id), - readStateType: 0 + channels.push({ + channelId: c.channel.id, + messageId: ReadStateStore.lastMessageId(c.channel.id), + readStateType: 0 + }); }); - }); }); FluxDispatcher.dispatch({