mirror of
https://github.com/block/buzz.git
synced 2026-08-18 06:50:31 +02:00
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:
@@ -155,6 +155,7 @@ export function AppShell() {
|
||||
);
|
||||
const refetchHomeFeedOnLiveMention = React.useEffectEvent(() => {
|
||||
void homeFeedQuery.refetch();
|
||||
void queryClient.invalidateQueries({ queryKey: channelsQueryKey });
|
||||
});
|
||||
|
||||
const handleDmNotification = React.useEffectEvent(
|
||||
|
||||
@@ -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,
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user