Skip to content

Commit e8b1e43

Browse files
committed
Fix duplicate logs appearing
1 parent 9513acf commit e8b1e43

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

site/src/components/Resources/AgentRow.tsx

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -84,13 +84,13 @@ export const AgentRow: FC<AgentRowProps> = ({
8484
showApps &&
8585
((agent.status === "connected" && hasAppsToDisplay) ||
8686
agent.status === "connecting");
87-
const logSourceByID = useMemo(() => {
88-
const sources: { [id: string]: WorkspaceAgentLogSource } = {};
89-
for (const source of agent.log_sources) {
90-
sources[source.id] = source;
91-
}
92-
return sources;
93-
}, [agent.log_sources]);
87+
const logSourceByID = useMemo(() => {
88+
const sources: { [id: string]: WorkspaceAgentLogSource } = {};
89+
for (const source of agent.log_sources) {
90+
sources[source.id] = source;
91+
}
92+
return sources;
93+
}, [agent.log_sources]);
9494
const hasStartupFeatures = Boolean(agent.logs_length);
9595
const { proxy } = useProxy();
9696
const [showLogs, setShowLogs] = useState(
@@ -427,6 +427,7 @@ const useAgentLogs = (
427427
useEffect(() => {
428428
if (!enabled) {
429429
socket.current?.close();
430+
setLogs([]);
430431
return;
431432
}
432433

0 commit comments

Comments
 (0)