Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/components/AgentTerminal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,11 @@

useEffect(() => {
if (claimHistory.length > lastHistoryLen.current) {
const latest = claimHistory[claimHistory.length - 1]
const latest = claimHistory.at(-1)
lastHistoryLen.current = claimHistory.length
setLogs((prev) => {
const msg = `[TRK] Asteroid ${latest.id} ${latest.action === "CLAIMED" ? "claimed and secured" : "claim released"}`

Check failure on line 102 in src/components/AgentTerminal.tsx

View workflow job for this annotation

GitHub Actions / typecheck

'latest' is possibly 'undefined'.

Check failure on line 102 in src/components/AgentTerminal.tsx

View workflow job for this annotation

GitHub Actions / typecheck

'latest' is possibly 'undefined'.
const next = [...prev, { time: latest.timestamp.toLocaleTimeString("en-US", { hour: "2-digit", minute: "2-digit", second: "2-digit", hour12: false }), msg }]

Check failure on line 103 in src/components/AgentTerminal.tsx

View workflow job for this annotation

GitHub Actions / typecheck

'latest' is possibly 'undefined'.
if (next.length > 50) next.splice(0, next.length - 50)
return next
})
Expand Down
Loading