feat(sidebar): show DMs under home button

This commit is contained in:
Paul
2021-12-24 23:53:26 +00:00
parent f68f145470
commit b9dc8b91db
2 changed files with 60 additions and 28 deletions

View File

@@ -48,6 +48,11 @@ export default observer(() => {
a.last_message_id_or_past.localeCompare(b.last_message_id_or_past),
);
// ! FIXME: must be a better way
const incoming = [...client.users.values()].filter(
(user) => user?.relationship === RelationshipStatus.Incoming,
);
return (
<GenericSidebarBase mobilePadding>
<ConnectionStatus />
@@ -68,14 +73,9 @@ export default observer(() => {
<ButtonItem
active={pathname === "/friends"}
alert={
typeof [...client.users.values()].find(
(user) =>
user?.relationship ===
RelationshipStatus.Incoming,
) !== "undefined"
? "unread"
: undefined
}>
incoming.length > 0 ? "mention" : undefined
}
alertCount={incoming.length}>
<UserDetail size={20} />
<span>
<Text id="app.navigation.tabs.friends" />