fix(ui): a task row's action error clears when the task changes status (#1872)

This commit is contained in:
sam committed 2026-11-14 12:11:04 +11:00
1 parent 5f45cdebb5
commit 236d0b678a
1 file changed
+3 -1
+3 -1
View File
@@ -1,5 +1,5 @@
<script setup lang="ts">
import { computed, ref } from "vue";
import { computed, ref, watch } from "vue";
import { useRouter } from "vue-router";
import { RadioGroup, RadioGroupItem } from "@/components/ui/radio-group";
@@ -75,6 +75,8 @@ const gate = computed(() => props.task.status === "waiting_approval" ? reviewGat
const approveDisabled = computed(() => !!gate.value && props.findings?.length === 0);
const inFlight = ref(false);
const error = ref<{ kind: ActionErrorKind; message: string } | null>(null);
// A refusal is about the state it was made in; once the task moves on it is stale.
watch(() => props.task.status, () => (error.value = null));
// The dialog's open flag and the action it will run are two refs, not one:
// pressing the dialog's action closes it, and that close clears the open flag