Skip to content

Commit 0ee3d7b

Browse files
Merge pull request #586 from Aeledfyr/travel-friend-fix
fix: don't show blocked users as friends in quick travel modal
2 parents 51b21fc + ced42c6 commit 0ee3d7b

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/components/QuickTravel/QuickTravelController.tsx

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ChannelType } from "@/chat-api/RawData";
1+
import { ChannelType, FriendStatus } from "@/chat-api/RawData";
22
import useStore from "@/chat-api/store/useStore";
33
import { createContextProvider } from "@solid-primitives/context";
44
import {
@@ -50,7 +50,8 @@ const [QuickTravelControllerProvider, useQuickTravelController] =
5050
const users = store.users.array();
5151

5252
return users.map((user) => {
53-
const friend = store.friends.get(user.id);
53+
const friend =
54+
store.friends.get(user.id)?.status === FriendStatus.FRIENDS;
5455
const inbox = user.inboxChannelId
5556
? store.inbox.get(user.inboxChannelId)
5657
: undefined;
@@ -127,8 +128,12 @@ const [QuickTravelControllerProvider, useQuickTravelController] =
127128
const inboxA = "inbox" in a && !!a.inbox;
128129
const inboxB = "inbox" in b && !!b.inbox;
129130

130-
const friendA = "id" in a && !!store.friends.get(a.id!);
131-
const friendB = "id" in b && !!store.friends.get(b.id!);
131+
const friendA =
132+
"id" in a &&
133+
store.friends.get(a.id!)?.status === FriendStatus.FRIENDS;
134+
const friendB =
135+
"id" in b &&
136+
store.friends.get(b.id!)?.status === FriendStatus.FRIENDS;
132137

133138
if (inboxA && !inboxB) return -1;
134139
if (!inboxA && inboxB) return 1;

0 commit comments

Comments
 (0)