Language and logout bug
This commit is contained in:
parent
f047e50989
commit
f1601257c7
12 changed files with 287 additions and 122 deletions
|
|
@ -106,6 +106,7 @@ export default function MapPage({
|
|||
initialTravelTime,
|
||||
initialPostcode,
|
||||
shareCode,
|
||||
onSessionRejected,
|
||||
user,
|
||||
onLoginClick,
|
||||
onRegisterClick,
|
||||
|
|
@ -293,6 +294,7 @@ export default function MapPage({
|
|||
filterRange,
|
||||
travelTimeEntries: entries,
|
||||
shareCode,
|
||||
onSessionRejected,
|
||||
});
|
||||
|
||||
// Read the zoom through a ref inside handleAiFilterSubmit so panning/zooming
|
||||
|
|
@ -765,6 +767,20 @@ export default function MapPage({
|
|||
}
|
||||
}, [filtersUnlimited, lockFilterAdds, effectiveFilterCap, filters, entries]);
|
||||
|
||||
// When the cap tightens (logout / session invalidated / license lapse), useFilters
|
||||
// re-clamps the feature filters, but travel-time entries — which count toward the same
|
||||
// server cap — live here. Trim them to the cap too so the combined request can't exceed
|
||||
// it and blank the map. Read via ref so this only fires on a cap change, not on every
|
||||
// travel edit (those are already gated by handleAddTravelTimeEntry).
|
||||
const entriesRef = useRef(entries);
|
||||
entriesRef.current = entries;
|
||||
useEffect(() => {
|
||||
if (filtersUnlimited) return;
|
||||
if (entriesRef.current.length > effectiveFilterCap) {
|
||||
handleSetEntries(entriesRef.current.slice(0, effectiveFilterCap));
|
||||
}
|
||||
}, [effectiveFilterCap, filtersUnlimited, handleSetEntries]);
|
||||
|
||||
const handleUpgradeClick = useCallback(() => {
|
||||
onNavigateTo('pricing');
|
||||
}, [onNavigateTo]);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue