Skip to content

πŸ™Œ OpenHands: AI-Driven Development

fix(frontend): NaN is shown on the conversation card (#9581)

Hiep Le0bed046fcc89
diff --git a/frontend/src/components/features/conversation-panel/conversation-card.tsx b/frontend/src/components/features/conversation-panel/conversation-card.tsx
index f02b4799dc..cdd0c4b680 100644
--- a/frontend/src/components/features/conversation-panel/conversation-card.tsx
+++ b/frontend/src/components/features/conversation-panel/conversation-card.tsx
@@ -274,22 +274,24 @@ export function ConversationCard({
variant={variant}
/>
)}
- <p className="text-xs text-neutral-400">
- <span>{t(I18nKey.CONVERSATION$CREATED)} </span>
- <time>
- {formatTimeDelta(new Date(createdAt || lastUpdatedAt))}{" "}
- {t(I18nKey.CONVERSATION$AGO)}
- </time>
- {showUpdateTime && (
- <>
- <span>{t(I18nKey.CONVERSATION$UPDATED)} </span>
- <time>
- {formatTimeDelta(new Date(lastUpdatedAt))}{" "}
- {t(I18nKey.CONVERSATION$AGO)}
- </time>
- </>
- )}
- </p>
+ {(createdAt || lastUpdatedAt) && (
+ <p className="text-xs text-neutral-400">
+ <span>{t(I18nKey.CONVERSATION$CREATED)} </span>
+ <time>
+ {formatTimeDelta(new Date(createdAt || lastUpdatedAt))}{" "}
+ {t(I18nKey.CONVERSATION$AGO)}
+ </time>
+ {showUpdateTime && (
+ <>
+ <span>{t(I18nKey.CONVERSATION$UPDATED)} </span>
+ <time>
+ {formatTimeDelta(new Date(lastUpdatedAt))}{" "}
+ {t(I18nKey.CONVERSATION$AGO)}
+ </time>
+ </>
+ )}
+ </p>
+ )}
</div>
</div>