fix: not showing servers in the ServerDrawer

This commit is contained in:
kmmiio99o 2026-07-25 11:16:11 +02:00
parent a526a36443
commit ddcef7c85b
No known key found for this signature in database
GPG key ID: DCC0431E10FADBF1

View file

@ -5,6 +5,7 @@ import { GuildNode } from "../utils/theme";
import GuildItem from "./GuildItem"; import GuildItem from "./GuildItem";
import FolderItem from "./FolderItem"; import FolderItem from "./FolderItem";
const Flux = findByProps("useStateFromStores");
const SortedGuildStore = findByStoreName("SortedGuildStore"); const SortedGuildStore = findByStoreName("SortedGuildStore");
const RootNav = findByProps("getRootNavigationRef"); const RootNav = findByProps("getRootNavigationRef");
const Haptic = findByProps("triggerHapticFeedback", "HapticFeedbackTypes"); const Haptic = findByProps("triggerHapticFeedback", "HapticFeedbackTypes");
@ -28,10 +29,13 @@ export default function ServerDrawerSheet({ gestureContext }: { gestureContext:
} }
}, []); }, []);
const nodes: GuildNode[] = React.useMemo(() => { const nodes: GuildNode[] = Flux?.useStateFromStores?.(
const t = SortedGuildStore?.getGuildsTree(); [SortedGuildStore],
return (t?.root?.children || []).filter((n: GuildNode) => n.type !== "root"); () => {
}, []); const t = SortedGuildStore?.getGuildsTree();
return (t?.root?.children || []).filter((n: GuildNode) => n.type !== "root");
},
) ?? [];
const ctx = (gestureContext ? React.useContext(gestureContext) : null) as any; const ctx = (gestureContext ? React.useContext(gestureContext) : null) as any;
const minH = ctx?.minExpandedContentHeight; const minH = ctx?.minExpandedContentHeight;