fix(web): prevent date parsing sort drop to top of history for real-time messages

This commit is contained in:
2026-07-27 09:46:42 -04:00
parent 43b20c5ce3
commit 83c6badc20
3 changed files with 5 additions and 6 deletions
+2 -2
View File
@@ -2,10 +2,10 @@ import { create } from "zustand";
import { api } from "../lib/api.ts";
function parseDate(iso: string): number {
if (!iso) return 0;
if (!iso) return Date.now();
const normalized = iso.includes("T") ? iso : iso.replace(" ", "T");
const t = new Date(normalized).getTime();
return isNaN(t) ? 0 : t;
return isNaN(t) ? Date.now() : t;
}
export interface MessageEmbed {