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(ferratas): sort route tile keys with localeCompare

Maurice31ffcf1228ca
diff --git a/client/src/components/Ferratas/useTripFerratas.ts b/client/src/components/Ferratas/useTripFerratas.ts
index 29dbe437d..343a66384 100644
--- a/client/src/components/Ferratas/useTripFerratas.ts
+++ b/client/src/components/Ferratas/useTripFerratas.ts
@@ -112,7 +112,13 @@ export function useTripFerratas(
);
// The tiles a tour's line runs through load with the layer off too, for the warning
// that a route climbs a ferrata; only the layer's own state decides what it shows.
- const routeKey = routeTiles && routeTiles.length > 0 ? routeTiles.map(ferrataTileKey).sort().join('|') : null;
+ const routeKey =
+ routeTiles && routeTiles.length > 0
+ ? routeTiles
+ .map(ferrataTileKey)
+ .sort((a, b) => a.localeCompare(b))
+ .join('|')
+ : null;
const layerOn = enabled && !!store;
const active = layerOn || (!!routeKey && !!store);
const fits = !!view && ferrataBboxFits(view);