Skip to content

armgit / TREK

Public Imported from GitHub
0

The most complete open-source travel planner: real-time collaboration, bookings, budgets, packing lists, journals, offline PWA, SSO and an AI-ready MCP server, with planet-wide place search and routing built in.

fix(tours): sort the place categories of a search key by their names

Mauricec3229afcba8e
diff --git a/client/src/components/Tours/poi/useTourPoiSearch.ts b/client/src/components/Tours/poi/useTourPoiSearch.ts
index 0a0ccf1cb..3cf6c3dc6 100644
--- a/client/src/components/Tours/poi/useTourPoiSearch.ts
+++ b/client/src/components/Tours/poi/useTourPoiSearch.ts
@@ -32,7 +32,7 @@ function thinned(line: Array<[number, number]>, most: number): Array<[number, nu
/** What a search was asked with, so a later change of the route or the choices shows it is out of date. */
function keyOf(route: Array<[number, number]> | null, type: string, categories: readonly string[], corridor: number) {
const ends = route && route.length > 1 ? [route[0], route[route.length - 1], route.length] : [];
- return JSON.stringify([ends, type, [...categories].sort(), corridor]);
+ return JSON.stringify([ends, type, [...categories].sort((a, b) => a.localeCompare(b)), corridor]);
}
export type TourPoiPlanner = Pick<TourPlannerController, 'tripId' | 'tourType' | 'route' | 'mode'>;