Skip to content

Commit

Permalink
initial render to 4&5 min. ago. All inputs synced
Browse files Browse the repository at this point in the history
  • Loading branch information
amabelleS committed Oct 26, 2023
1 parent f0cafe3 commit 2370145
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/pages/RealtimeMapPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ export function numberToColorHsl(i: number, max: number) {
return `hsl(${hue}, ${saturation}%, ${lightness}%)`
}

const now = moment()
const oneMinuteAgo = moment().subtract(1, 'minutes')
const fiveMinutesAgo = moment().subtract(5, 'minutes')
const fourMinutesAgo = moment().subtract(4, 'minutes')

export default function RealtimeMapPage() {
const position: Point = {
Expand All @@ -56,8 +56,8 @@ export default function RealtimeMapPage() {
}

//TODO (another PR and another issue) load from url like in another pages.
const [from, setFrom] = useState(oneMinuteAgo)
const [to, setTo] = useState(now)
const [from, setFrom] = useState(fiveMinutesAgo)
const [to, setTo] = useState(fourMinutesAgo)

const { locations, isLoading } = useVehicleLocations({
from,
Expand Down

0 comments on commit 2370145

Please sign in to comment.