TUI: fix: add null check for user.time in duration calculation (#4679)
parent
75c0c0a098
commit
bcb494d5d1
|
|
@ -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…
Reference in New Issue