diff --git a/web-new/src/pages/Review.tsx b/web-new/src/pages/Review.tsx index 7b6f04a4e..785ae6700 100644 --- a/web-new/src/pages/Review.tsx +++ b/web-new/src/pages/Review.tsx @@ -10,12 +10,10 @@ import { formatUnixTimestampToDateTime } from "@/utils/dateUtil"; export function Review() { const { data: config } = useSWR("config"); const timezone = useMemo(() => config?.ui?.timezone || Intl.DateTimeFormat().resolvedOptions().timeZone, [config]); - const start = useMemo(() => new Date().getTime() / 1000, []); const { data: hourlyTimeline } = useSWR(['timeline/hourly', { timezone }]); - const { data: allPreviews } = useSWR(`preview/all/start/${Object.keys(hourlyTimeline || [0])[0]}/end/${start}`, { revalidateOnFocus: false }); + const { data: allPreviews } = useSWR(`preview/all/start/${hourlyTimeline?.start}/end/${hourlyTimeline?.end}`, { revalidateOnFocus: false }); - // detail levels can be normal, extra, full - const [detailLevel, setDetailLevel] = useState('normal'); + const [detailLevel, setDetailLevel] = useState<'normal' | 'extra' | 'full'>('normal'); const timelineCards: CardsData | never[] = useMemo(() => { if (!hourlyTimeline) {