Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 20 additions & 6 deletions desktop/src/features/channels/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
});
}
},
});
}
Expand All @@ -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);
},
});
}
Expand All @@ -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);
},
});
}
Expand Down
Loading