use filtered query for joined servers
This commit is contained in:
@@ -9,9 +9,8 @@ export const useSubscriptions = (
|
||||
activeServerId: bigint | null,
|
||||
activeChannelId: bigint | null,
|
||||
connectedVoiceChannelId: bigint | null = null,
|
||||
discovery: boolean = false,
|
||||
) => {
|
||||
const [servers] = useTable(useMemo(() => tables.server, []));
|
||||
|
||||
const [activeServerMembers] = useTable(
|
||||
useMemo(
|
||||
() =>
|
||||
@@ -33,6 +32,13 @@ export const useSubscriptions = (
|
||||
),
|
||||
);
|
||||
|
||||
const joinedServerIds = useMemo(
|
||||
() => (ownMemberships || []).map((m) => m.serverId),
|
||||
[ownMemberships],
|
||||
);
|
||||
|
||||
const [servers] = useTable(useMemo(() => tables.server, []));
|
||||
|
||||
const serverMembers = useMemo(() => {
|
||||
const combined = [...(activeServerMembers || []), ...(ownMemberships || [])];
|
||||
// De-duplicate
|
||||
|
||||
@@ -129,6 +129,14 @@ export function useChat(): ChatState {
|
||||
bootstrapSubs.serverMembers,
|
||||
);
|
||||
|
||||
const discovery = useDiscovery();
|
||||
|
||||
const actions = useActions(
|
||||
navigation.activeServerId,
|
||||
navigation.activeChannelId,
|
||||
navigation.activeThreadId,
|
||||
);
|
||||
|
||||
const voiceStatus = useVoiceStatus(
|
||||
identity || null,
|
||||
bootstrapSubs.voiceStates,
|
||||
@@ -144,16 +152,9 @@ export function useChat(): ChatState {
|
||||
navigation.activeServerId,
|
||||
navigation.activeChannelId,
|
||||
voiceStatus.connectedVoiceChannel?.id || null,
|
||||
discovery.showDiscoveryModal,
|
||||
);
|
||||
|
||||
const actions = useActions(
|
||||
navigation.activeServerId,
|
||||
navigation.activeChannelId,
|
||||
navigation.activeThreadId,
|
||||
);
|
||||
|
||||
const discovery = useDiscovery();
|
||||
|
||||
// Derived Data (Moved back to main orchestrator for now as they use multiple hook results)
|
||||
const isFullyAuthenticated = useMemo(() => {
|
||||
const user = activeSubs.users.find((u) =>
|
||||
|
||||
Reference in New Issue
Block a user