diff --git a/ui/src/components/agents/AgentThreadView.tsx b/ui/src/components/agents/AgentThreadView.tsx index a8bfa419..0080e8da 100644 --- a/ui/src/components/agents/AgentThreadView.tsx +++ b/ui/src/components/agents/AgentThreadView.tsx @@ -29,7 +29,6 @@ import { useWorkflowApprovals, } from "@/lib/agents/queries" import { WorkflowApprovalCard } from "@/components/agents/WorkflowApprovalCard" -import { useSession } from "@/lib/session" interface AgentThreadViewProps { thread: AgentThread @@ -136,12 +135,9 @@ export function AgentThreadView({ thread }: AgentThreadViewProps) { const approvalsQuery = useWorkflowApprovals(thread.id) const approveMutation = useApproveWorkflowPush(thread.id) const rejectMutation = useRejectWorkflowPush(thread.id) - const session = useSession() - const pendingApprovals = approvalsQuery.data?.filter( - (a) => a.status === "pending" - ) - const isApprovalOwner = thread.isOwner ?? session.data?.login === thread.id + const approvals = approvalsQuery.data + const isApprovalOwner = thread.isOwner ?? false const hasWorkflowApprovalError = useMemo( () => @@ -202,9 +198,9 @@ export function AgentThreadView({ thread }: AgentThreadViewProps) { )} {hasConversation ? (
- {pendingApprovals && pendingApprovals.length > 0 && ( + {approvals && approvals.length > 0 && (
- {pendingApprovals.map((approval) => ( + {approvals.map((approval) => (