mirror of
https://github.com/sst/opencode.git
synced 2025-12-23 10:11:41 +00:00
TUI: fix: add null check for user.time in duration calculation (#4679)
This commit is contained in:
parent
75c0c0a098
commit
bcb494d5d1
1 changed files with 1 additions and 1 deletions
|
|
@ -1008,7 +1008,7 @@ function AssistantMessage(props: { message: AssistantMessage; parts: Part[]; las
|
|||
if (!final()) return 0
|
||||
if (!props.message.time.completed) return 0
|
||||
const user = messages().find((x) => x.role === "user" && x.id === props.message.parentID)
|
||||
if (!user) return 0
|
||||
if (!user || !user.time) return 0
|
||||
return props.message.time.completed - user.time.created
|
||||
})
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue