Skip to content

Record your screen, ship a demo. Free and open-source, GPU-accelerated, no watermarks, no subscriptions. Windows, macOS, Linux. Actively maintained.

fix(chat): show a stored time that is no date as stored

EtienneLescot8ec760be5a4d
diff --git a/src/components/ai-edition/LeftPanel.tsx b/src/components/ai-edition/LeftPanel.tsx
index 194bd73d2..84c5227b7 100644
--- a/src/components/ai-edition/LeftPanel.tsx
+++ b/src/components/ai-edition/LeftPanel.tsx
@@ -47,6 +47,12 @@ interface ChatDisplayMessage {
thinking?: string;
}
+/** A message's clock time; a stored value that is no date is shown as stored. */
+function formatMessageTime(time: string): string {
+ const date = new Date(time);
+ return Number.isNaN(date.getTime()) ? time : date.toLocaleTimeString();
+}
+
// Quick-access model picker anchored to the composer's model pill — mirrors
// axcut's LlmPopover in "models"/"providers" mode (a lightweight popover, not
// the full AI-settings modal). "Provider settings…" in the providers screen
@@ -1264,7 +1270,7 @@ export function ChatStripPanel() {
color: "var(--muted)",
}}
>
- {new Date(m.time).toLocaleTimeString()}
+ {formatMessageTime(m.time)}
</span>
) : null}
</div>