mirror of
https://github.com/block/buzz.git
synced 2026-08-18 06:50:31 +02:00
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:
@@ -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
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user