mirror of
https://github.com/block/buzz.git
synced 2026-12-01 13:42:45 +00:00
fix(desktop): stop edit-channel dialog hanging on "Saving..." (#1557)
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:
@@ -268,8 +268,20 @@ export function useUpdateChannelMutation(channelId: string | null) {
|
||||
),
|
||||
);
|
||||
},
|
||||
onSettled: async () => {
|
||||
await invalidateChannelState(queryClient, channelId);
|
||||
onSettled: () => {
|
||||
// refetchType "none": onSuccess already cached the relay-returned detail;
|
||||
// awaiting the full channel-list refetch kept the edit dialog stuck on
|
||||
// "Saving..." (same failure #1360 fixed for create).
|
||||
void queryClient.invalidateQueries({
|
||||
queryKey: channelsQueryKey,
|
||||
refetchType: "none",
|
||||
});
|
||||
if (channelId) {
|
||||
void queryClient.invalidateQueries({
|
||||
queryKey: channelDetailQueryKey(channelId),
|
||||
refetchType: "none",
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
@@ -285,8 +297,9 @@ export function useSetChannelTopicMutation(channelId: string | null) {
|
||||
|
||||
return setChannelTopic({ ...input, channelId });
|
||||
},
|
||||
onSettled: async () => {
|
||||
await invalidateChannelState(queryClient, channelId);
|
||||
onSettled: () => {
|
||||
// fire-and-forget: awaiting the channels-list refetch blocks the dialog
|
||||
void invalidateChannelState(queryClient, channelId);
|
||||
},
|
||||
});
|
||||
}
|
||||
@@ -302,8 +315,9 @@ export function useSetChannelPurposeMutation(channelId: string | null) {
|
||||
|
||||
return setChannelPurpose({ ...input, channelId });
|
||||
},
|
||||
onSettled: async () => {
|
||||
await invalidateChannelState(queryClient, channelId);
|
||||
onSettled: () => {
|
||||
// fire-and-forget: awaiting the channels-list refetch blocks the dialog
|
||||
void invalidateChannelState(queryClient, channelId);
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user