diff --git a/desktop/src/features/channels/hooks.ts b/desktop/src/features/channels/hooks.ts index 91e6aebd62f..2c41ff1e741 100644 --- a/desktop/src/features/channels/hooks.ts +++ b/desktop/src/features/channels/hooks.ts @@ -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); }, }); }