mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-12-01 00:43:15 +00:00
5b4a7e82ff
The trip planner and the journal get a "From Dawarich" list: the stays recorded for those dates, each one a row that can be dismissed or turned into a place or an entry after a review step that shows time, name, note and day. A place that came from a recording carries the Dawarich mark next to its name so its origin stays visible afterwards. The recorded route lies over the trip and journal maps as an overlay, coloured per day and cut along the reader's own timezone rather than UTC. It is fetched for the window on screen and never stored. The Atlas gets its own panel beside the map for the countries and cities the recordings prove, and the wish list is ticked off there, on the day of the visit, undoably. The phone has its own take on all of it, in the mobile shell's colours and with native sheets.
19 lines
877 B
TypeScript
19 lines
877 B
TypeScript
import { useTripStore } from '../../store/tripStore'
|
|
|
|
/**
|
|
* Pull the trip back in after a stay was accepted into it.
|
|
*
|
|
* The acceptance is written server-side, so the planner knows nothing about the
|
|
* place it produced until somebody reloads the page — which is exactly what a
|
|
* person should never have to do after pressing a button. Both trip shells call
|
|
* this, which is also why it is a plain function rather than a hook: one line at
|
|
* each call site keeps the desktop and phone copies from drifting.
|
|
*
|
|
* Places and days both, because a stay accepted onto a day creates an assignment
|
|
* as well, and the day rail would otherwise stay one place short.
|
|
*/
|
|
export async function refreshTripAfterAccept(tripId: number | string): Promise<void> {
|
|
const store = useTripStore.getState()
|
|
await Promise.all([store.refreshPlaces(tripId), store.refreshDays(tripId)])
|
|
}
|