From ddcef7c85b80dee903745cd0c56fac33ca543c60 Mon Sep 17 00:00:00 2001 From: kmmiio99o Date: Sat, 25 Jul 2026 11:16:11 +0200 Subject: [PATCH] fix: not showing servers in the ServerDrawer --- .../src/components/ServerDrawerSheet.tsx | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/plugins/ServerDrawer/src/components/ServerDrawerSheet.tsx b/plugins/ServerDrawer/src/components/ServerDrawerSheet.tsx index 9ac0320..d3ac01a 100644 --- a/plugins/ServerDrawer/src/components/ServerDrawerSheet.tsx +++ b/plugins/ServerDrawer/src/components/ServerDrawerSheet.tsx @@ -5,6 +5,7 @@ import { GuildNode } from "../utils/theme"; import GuildItem from "./GuildItem"; import FolderItem from "./FolderItem"; +const Flux = findByProps("useStateFromStores"); const SortedGuildStore = findByStoreName("SortedGuildStore"); const RootNav = findByProps("getRootNavigationRef"); const Haptic = findByProps("triggerHapticFeedback", "HapticFeedbackTypes"); @@ -28,10 +29,13 @@ export default function ServerDrawerSheet({ gestureContext }: { gestureContext: } }, []); - const nodes: GuildNode[] = React.useMemo(() => { - const t = SortedGuildStore?.getGuildsTree(); - return (t?.root?.children || []).filter((n: GuildNode) => n.type !== "root"); - }, []); + const nodes: GuildNode[] = Flux?.useStateFromStores?.( + [SortedGuildStore], + () => { + const t = SortedGuildStore?.getGuildsTree(); + return (t?.root?.children || []).filter((n: GuildNode) => n.type !== "root"); + }, + ) ?? []; const ctx = (gestureContext ? React.useContext(gestureContext) : null) as any; const minH = ctx?.minExpandedContentHeight;