fix: stabilize live activity updates
This commit is contained in:
@@ -2079,12 +2079,14 @@ const ActivityChainSummary: FC<{
|
||||
setElapsedMs(storedElapsedMs);
|
||||
return;
|
||||
}
|
||||
const explicitStartedAt =
|
||||
metadataRunStartedAtMs ?? contentRunStartedAtMs ?? messageCreatedAtMs;
|
||||
if (explicitStartedAt !== null) {
|
||||
liveStartedAtRef.current = explicitStartedAt;
|
||||
const authoritativeStartedAt =
|
||||
metadataRunStartedAtMs ?? contentRunStartedAtMs;
|
||||
if (authoritativeStartedAt !== null) {
|
||||
liveStartedAtRef.current = authoritativeStartedAt;
|
||||
} else if (liveStartedAtRef.current === null && storedElapsedMs !== null) {
|
||||
liveStartedAtRef.current = Date.now() - storedElapsedMs;
|
||||
} else if (liveStartedAtRef.current === null && messageCreatedAtMs !== null) {
|
||||
liveStartedAtRef.current = messageCreatedAtMs;
|
||||
}
|
||||
const startedAt = liveStartedAtRef.current;
|
||||
if (startedAt === null) {
|
||||
|
||||
Reference in New Issue
Block a user