readAllNotificationsButton: also mark voice channels as read (#2140)
This commit is contained in:
parent
64fa2f8652
commit
ec53b0230f
1 changed files with 9 additions and 8 deletions
|
@ -25,16 +25,17 @@ function onClick() {
|
||||||
const channels: Array<any> = [];
|
const channels: Array<any> = [];
|
||||||
|
|
||||||
Object.values(GuildStore.getGuilds()).forEach(guild => {
|
Object.values(GuildStore.getGuilds()).forEach(guild => {
|
||||||
GuildChannelStore.getChannels(guild.id).SELECTABLE.forEach((c: { channel: { id: string; }; }) => {
|
GuildChannelStore.getChannels(guild.id).SELECTABLE
|
||||||
if (!ReadStateStore.hasUnread(c.channel.id)) return;
|
.concat(GuildChannelStore.getChannels(guild.id).VOCAL)
|
||||||
|
.forEach((c: { channel: { id: string; }; }) => {
|
||||||
|
if (!ReadStateStore.hasUnread(c.channel.id)) return;
|
||||||
|
|
||||||
channels.push({
|
channels.push({
|
||||||
channelId: c.channel.id,
|
channelId: c.channel.id,
|
||||||
// messageId: c.channel?.lastMessageId,
|
messageId: ReadStateStore.lastMessageId(c.channel.id),
|
||||||
messageId: ReadStateStore.lastMessageId(c.channel.id),
|
readStateType: 0
|
||||||
readStateType: 0
|
});
|
||||||
});
|
});
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
FluxDispatcher.dispatch({
|
FluxDispatcher.dispatch({
|
||||||
|
|
Loading…
Reference in a new issue