fix: Retry blocked task button does nothing due to missing query invalidation
retryBlockedTask was not in the centralized invalidation map, so the mutation succeeded server-side but the UI never refreshed. Also changed the button to wait for the mutation response before closing the slide-over and show a loading spinner.
This commit is contained in:
@@ -272,13 +272,16 @@ export function TaskSlideOver({ onOpenChat }: TaskSlideOverProps) {
|
||||
variant="outline"
|
||||
size="sm"
|
||||
className="gap-1.5"
|
||||
disabled={retryBlockedTaskMutation.isPending}
|
||||
onClick={() => {
|
||||
retryBlockedTaskMutation.mutate({ taskId: task.id });
|
||||
close();
|
||||
retryBlockedTaskMutation.mutate(
|
||||
{ taskId: task.id },
|
||||
{ onSuccess: () => close() },
|
||||
);
|
||||
}}
|
||||
>
|
||||
<RotateCw className="h-3.5 w-3.5" />
|
||||
Retry
|
||||
<RotateCw className={cn("h-3.5 w-3.5", retryBlockedTaskMutation.isPending && "animate-spin")} />
|
||||
{retryBlockedTaskMutation.isPending ? "Retrying…" : "Retry"}
|
||||
</Button>
|
||||
) : (
|
||||
<Button
|
||||
|
||||
@@ -70,6 +70,7 @@ const INVALIDATION_MAP: Partial<Record<MutationName, QueryName[]>> = {
|
||||
queueTask: ["listTasks", "listInitiativeTasks", "listPhaseTasks"],
|
||||
|
||||
deleteTask: ["listTasks", "listInitiativeTasks", "listPhaseTasks", "listChangeSets"],
|
||||
retryBlockedTask: ["listTasks", "listInitiativeTasks", "listPhaseTasks", "listAgents"],
|
||||
|
||||
// --- Change Sets ---
|
||||
revertChangeSet: ["listPhases", "listPhaseTasks", "listInitiativeTasks", "listPages", "getPage", "listChangeSets", "getRootPage", "getChangeSet"],
|
||||
|
||||
Reference in New Issue
Block a user