mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-10-19 05:26:47 +00:00
b5ebffa115
The hero picks the trip that is running, else the next one coming up, else just trips[0] — and that pick was then removed from the grid below. The first two cases are deliberate: the trip is already on screen, showing it again right underneath would be noise. The trips[0] fallback is a different thing. It fires precisely when nothing qualifies, so it borrows a trip that belongs in the grid, and removing it there leaves the user with a hero and an empty list. Someone whose trips are all finished sees "No trips yet" under a card of the trip they just came back from. Split the two: only a trip that earned the hero is taken out of the grid. Undated trips were caught by this too, and worse — getTripStatus returns null rather than 'past' for them, so a lone dateless trip appeared in no tab at all. The empty state was the second half of the report. It equated "planned is empty" with "you have no trips" and told people to create their first one. Gate it on there being no trip at all, which is the condition the mobile dashboard already uses. Mobile shares useDashboard, so it is fixed along with the desktop. Closes #1706