fix(web): prevent date parsing sort drop to top of history for real-time messages
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user