perf(desktop): don't block channel create on channel-list refetch (#1360)

Signed-off-by: Wes <wesbillman@users.noreply.github.com>
Co-authored-by: Brain <21994759fc7a6fa6b965551d35cfd7897d262f2495467f2d78694ddcfa6a5c7e@sprout-oss.stage.blox.sqprod.co>
This commit is contained in:
Wes
2026-06-29 12:55:31 -07:00
committed by GitHub
co-authored by Brain
parent c27b4251a9
commit cf57bcbea4
2 changed files with 9 additions and 3 deletions
+8 -2
View File
@@ -125,8 +125,14 @@ export function useCreateChannelMutation() {
]),
);
},
onSettled: async () => {
await queryClient.invalidateQueries({ queryKey: channelsQueryKey });
onSettled: () => {
// refetchType "none": onSuccess already cached the relay-returned channel;
// an immediate getChannels() refetch blocked the dialog and could clobber
// it with a read-after-write-lagged snapshot. Live updates reconcile later.
void queryClient.invalidateQueries({
queryKey: channelsQueryKey,
refetchType: "none",
});
},
});
}
@@ -23,7 +23,7 @@ export function getChannelIntroDescription(channel: Channel): string | null {
return (
channel.topic?.trim() ||
channel.purpose?.trim() ||
channel.description.trim() ||
channel.description?.trim() ||
null
);
}