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"
|
variant="outline"
|
||||||
size="sm"
|
size="sm"
|
||||||
className="gap-1.5"
|
className="gap-1.5"
|
||||||
|
disabled={retryBlockedTaskMutation.isPending}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
retryBlockedTaskMutation.mutate({ taskId: task.id });
|
retryBlockedTaskMutation.mutate(
|
||||||
close();
|
{ taskId: task.id },
|
||||||
|
{ onSuccess: () => close() },
|
||||||
|
);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<RotateCw className="h-3.5 w-3.5" />
|
<RotateCw className={cn("h-3.5 w-3.5", retryBlockedTaskMutation.isPending && "animate-spin")} />
|
||||||
Retry
|
{retryBlockedTaskMutation.isPending ? "Retrying…" : "Retry"}
|
||||||
</Button>
|
</Button>
|
||||||
) : (
|
) : (
|
||||||
<Button
|
<Button
|
||||||
|
|||||||
@@ -70,6 +70,7 @@ const INVALIDATION_MAP: Partial<Record<MutationName, QueryName[]>> = {
|
|||||||
queueTask: ["listTasks", "listInitiativeTasks", "listPhaseTasks"],
|
queueTask: ["listTasks", "listInitiativeTasks", "listPhaseTasks"],
|
||||||
|
|
||||||
deleteTask: ["listTasks", "listInitiativeTasks", "listPhaseTasks", "listChangeSets"],
|
deleteTask: ["listTasks", "listInitiativeTasks", "listPhaseTasks", "listChangeSets"],
|
||||||
|
retryBlockedTask: ["listTasks", "listInitiativeTasks", "listPhaseTasks", "listAgents"],
|
||||||
|
|
||||||
// --- Change Sets ---
|
// --- Change Sets ---
|
||||||
revertChangeSet: ["listPhases", "listPhaseTasks", "listInitiativeTasks", "listPages", "getPage", "listChangeSets", "getRootPage", "getChangeSet"],
|
revertChangeSet: ["listPhases", "listPhaseTasks", "listInitiativeTasks", "listPages", "getPage", "listChangeSets", "getRootPage", "getChangeSet"],
|
||||||
|
|||||||
Reference in New Issue
Block a user