fix(desktop): improve sidebar reactivity for new DMs and channel updates

Wire live mention WebSocket events to also invalidate the channels query,
so the sidebar refreshes immediately when activity is detected. Reduce
channels polling interval from 60s to 15s as a safety net for genuinely
new channels (e.g. bot-created DMs) that the WebSocket subscription
doesn't know about yet.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Wes
2026-04-28 18:57:30 -07:00
co-authored by Claude Opus 4.6
parent 8a2562dfd5
commit 01d46223bd
2 changed files with 3 additions and 2 deletions
+1
View File
@@ -155,6 +155,7 @@ export function AppShell() {
);
const refetchHomeFeedOnLiveMention = React.useEffectEvent(() => {
void homeFeedQuery.refetch();
void queryClient.invalidateQueries({ queryKey: channelsQueryKey });
});
const handleDmNotification = React.useEffectEvent(
+2 -2
View File
@@ -109,8 +109,8 @@ export function useChannelsQuery() {
return useQuery({
queryKey: channelsQueryKey,
queryFn: async () => sortChannels(await getChannels()),
staleTime: 60_000,
refetchInterval: 60_000,
staleTime: 15_000,
refetchInterval: 15_000,
refetchIntervalInBackground: false,
});
}