mirror of
https://github.com/revoltchat/revite.git
synced 2024-11-29 10:20:59 -05:00
Merge pull request #151 from ryanalexander/count-direct-messages
Treat direct messages as mention, group behavior is the same
This commit is contained in:
commit
43010b3b72
1 changed files with 7 additions and 6 deletions
|
@ -240,15 +240,16 @@ export const ServerListSidebar = observer(({ unreads, lastOpened }: Props) => {
|
||||||
let homeUnread: "mention" | "unread" | undefined;
|
let homeUnread: "mention" | "unread" | undefined;
|
||||||
let alertCount = 0;
|
let alertCount = 0;
|
||||||
for (const x of channels) {
|
for (const x of channels) {
|
||||||
if (
|
if (x.channel?.channel_type === "Group" && x.unread) {
|
||||||
(x.channel?.channel_type === "DirectMessage"
|
|
||||||
? x.channel?.active
|
|
||||||
: x.channel?.channel_type === "Group") &&
|
|
||||||
x.unread
|
|
||||||
) {
|
|
||||||
homeUnread = "unread";
|
homeUnread = "unread";
|
||||||
alertCount += x.alertCount ?? 0;
|
alertCount += x.alertCount ?? 0;
|
||||||
}
|
}
|
||||||
|
if (
|
||||||
|
x.channel?.channel_type === "DirectMessage" &&
|
||||||
|
x.unread &&
|
||||||
|
x.unread.length > 0
|
||||||
|
)
|
||||||
|
alertCount++;
|
||||||
}
|
}
|
||||||
|
|
||||||
alertCount += [...client.users.values()].filter(
|
alertCount += [...client.users.values()].filter(
|
||||||
|
|
Loading…
Reference in a new issue