diff --git a/src/App.tsx b/src/App.tsx index e2e2836..c23f7e5 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -9,8 +9,12 @@ import "./index.css"; export function App() { const [data, setData] = useState({ count: 0, plexts: [] }); const [loading, setLoading] = useState(true); - const [timestampFrom, setTimestampFrom] = useState(null); - const [timestampTo, setTimestampTo] = useState(null); + const [timestampFrom, setTimestampFrom] = useState(() => { + const eightHoursAgo = new Date(); + eightHoursAgo.setHours(eightHoursAgo.getHours() - 8); + return eightHoursAgo; + }); + const [timestampTo, setTimestampTo] = useState(() => new Date()); const [playerName, setPlayerName] = useState("all"); const [limit, setLimit] = useState(100); const [mapCenter, setMapCenter] = useState<[number, number]>([45.57, 12.36]);