Skip to content

Commit 52ff7e6

Browse files
committed
update logs panel
1 parent 1dc57c3 commit 52ff7e6

1 file changed

Lines changed: 9 additions & 12 deletions

File tree

apps/twig/src/renderer/features/task-detail/components/TaskLogsPanel.tsx

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -106,18 +106,15 @@ export function TaskLogsPanel({ taskId, task }: TaskLogsPanelProps) {
106106
useEffect(() => {
107107
if (!isCloud || !task.latest_run?.id) return;
108108
const runId = task.latest_run.id;
109-
trpcVanilla.cloudTask.setViewing
110-
.mutate({ taskId: task.id, runId, viewing: true })
111-
.catch(() => {});
112-
const cleanup = getSessionService().watchCloudTask(task.id, runId, () => {
113-
queryClient.invalidateQueries({ queryKey: ["tasks"] });
114-
});
115-
return () => {
116-
trpcVanilla.cloudTask.setViewing
117-
.mutate({ taskId: task.id, runId, viewing: false })
118-
.catch(() => {});
119-
cleanup?.();
120-
};
109+
const cleanup = getSessionService().watchCloudTask(
110+
task.id,
111+
runId,
112+
() => {
113+
queryClient.invalidateQueries({ queryKey: ["tasks"] });
114+
},
115+
true,
116+
);
117+
return cleanup;
121118
}, [isCloud, task.id, task.latest_run?.id, queryClient]);
122119

123120
// Local session connection

0 commit comments

Comments
 (0)