fix: not showing servers in the ServerDrawer
This commit is contained in:
parent
a526a36443
commit
ddcef7c85b
1 changed files with 8 additions and 4 deletions
|
|
@ -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;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue