From 3ff127f3d0ff9472645815af77f2cba068aaafdf Mon Sep 17 00:00:00 2001 From: Han Pan <1590184@qq.com> Date: Thu, 4 Jan 2024 11:01:31 +0800 Subject: [PATCH] fix: sorted problem, issue #9 --- components/tick-table.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/components/tick-table.tsx b/components/tick-table.tsx index e091de9..c7c8423 100644 --- a/components/tick-table.tsx +++ b/components/tick-table.tsx @@ -9,6 +9,11 @@ interface TickTableProps { } export default function TickTable(props: TickTableProps) { + const tickItems = Array.isArray(props.data) + ? [...props.data].sort( + (a, b) => parseInt(a.start_time_ms) - parseInt(b.start_time_ms) + ) + : [] return (