Skip to content

Commit cf57bcb

Browse files
wesbillmanBrain
andauthored
perf(desktop): don't block channel create on channel-list refetch (#1360)
Signed-off-by: Wes <[email protected]> Co-authored-by: Brain <21994759fc7a6fa6b965551d35cfd7897d262f2495467f2d78694ddcfa6a5c7e@sprout-oss.stage.blox.sqprod.co>
1 parent c27b425 commit cf57bcb

2 files changed

Lines changed: 9 additions & 3 deletions

File tree

‎desktop/src/features/channels/hooks.ts‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,14 @@ export function useCreateChannelMutation() {
125125
]),
126126
);
127127
},
128-
onSettled: async () => {
129-
await queryClient.invalidateQueries({ queryKey: channelsQueryKey });
128+
onSettled: () => {
129+
// refetchType "none": onSuccess already cached the relay-returned channel;
130+
// an immediate getChannels() refetch blocked the dialog and could clobber
131+
// it with a read-after-write-lagged snapshot. Live updates reconcile later.
132+
void queryClient.invalidateQueries({
133+
queryKey: channelsQueryKey,
134+
refetchType: "none",
135+
});
130136
},
131137
});
132138
}

‎desktop/src/features/channels/ui/ChannelPane.helpers.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export function getChannelIntroDescription(channel: Channel): string | null {
2323
return (
2424
channel.topic?.trim() ||
2525
channel.purpose?.trim() ||
26-
channel.description.trim() ||
26+
channel.description?.trim() ||
2727
null
2828
);
2929
}

0 commit comments

Comments
 (0)