diff --git a/src/components/navigation/left/HomeSidebar.tsx b/src/components/navigation/left/HomeSidebar.tsx
index 46497aac..12b51daf 100644
--- a/src/components/navigation/left/HomeSidebar.tsx
+++ b/src/components/navigation/left/HomeSidebar.tsx
@@ -66,16 +66,7 @@ function HomeSidebar(props: Props) {
.filter((x) => x.channel_type !== "SavedMessages")
.map((x) => mapChannelWithUnread(x, props.unreads));
- const users = useUsers(
- (
- channelsArr as (
- | Channels.DirectMessageChannel
- | Channels.GroupChannel
- )[]
- ).reduce((prev: any, cur) => [...prev, ...cur.recipients], []),
- ctx,
- );
-
+ const users = useUsers(undefined, ctx);
channelsArr.sort((b, a) => a.timestamp.localeCompare(b.timestamp));
return (
diff --git a/src/components/navigation/left/ServerListSidebar.tsx b/src/components/navigation/left/ServerListSidebar.tsx
index b8b9b325..881d6114 100644
--- a/src/components/navigation/left/ServerListSidebar.tsx
+++ b/src/components/navigation/left/ServerListSidebar.tsx
@@ -1,6 +1,6 @@
import { Plus } from "@styled-icons/boxicons-regular";
import { useLocation, useParams } from "react-router-dom";
-import { Channel, Servers } from "revolt.js/dist/api/objects";
+import { Channel, Servers, Users } from "revolt.js/dist/api/objects";
import styled, { css } from "styled-components";
import { attachContextMenu, openContextMenu } from "preact-context-menu";
@@ -19,6 +19,7 @@ import {
useForceUpdate,
useSelf,
useServers,
+ useUsers,
} from "../../../context/revoltjs/hooks";
import logoSVG from "../../../assets/logo.svg";
@@ -56,7 +57,7 @@ function Icon({
)}
{unread === "mention" && (
-
+
)}
);
@@ -184,6 +185,7 @@ export function ServerListSidebar({ unreads, lastOpened }: Props) {
const channels = (useChannels(undefined, ctx) as Channel[]).map((x) =>
mapChannelWithUnread(x, unreads),
);
+ const users = useUsers(undefined, ctx);
const unreadChannels = channels.filter((x) => x.unread).map((x) => x._id);
@@ -228,6 +230,10 @@ export function ServerListSidebar({ unreads, lastOpened }: Props) {
}
}
+ if (users.find((x) => x?.relationship === Users.Relationship.Incoming)) {
+ alertCount++;
+ }
+
if (alertCount > 0) homeUnread = "mention";
const homeActive =
typeof server === "undefined" && !path.startsWith("/invite");