Skip to content

Commit 0f9218b

Browse files
committed
Add option to hide service journeys with invalid ids
1 parent da52317 commit 0f9218b

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

src/hooks/useVehicleData.ts

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,13 @@ export default function useVehicleData(
4040
}
4141
}
4242
hydrate();
43-
}, [client, dispatch, filter, lineLayerOptions.includePointsOnLink]);
43+
}, [
44+
client,
45+
dispatch,
46+
filter,
47+
lineLayerOptions.includePointsOnLink,
48+
options.hideServiceJourneysWithInvalidIds,
49+
]);
4450

4551
/**
4652
* Set up subscription to receive updates on vehicles
@@ -74,7 +80,13 @@ export default function useVehicleData(
7480
subscription.unsubscribe();
7581
};
7682
}
77-
}, [client, dispatch, filter, subscriptionOptions]);
83+
}, [
84+
client,
85+
dispatch,
86+
filter,
87+
subscriptionOptions,
88+
options.hideServiceJourneysWithInvalidIds,
89+
]);
7890

7991
return state;
8092
}

src/hooks/useVehicleReducer.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,6 @@ const hydrate = (
6969
let numberOfExpiredVehicles = state.statistics.numberOfExpiredVehicles;
7070
let numberOfUpdatesInSession = state.statistics.numberOfUpdatesInSession;
7171

72-
console.log({ options });
73-
7472
let vehicles: Map<string, VehicleMapPoint> = payload.reduce(
7573
(acc: any, vehicle: Vehicle) => {
7674
numberOfUpdatesInSession++;
@@ -136,8 +134,6 @@ const update = (
136134

137135
let updatedVehicles = state.vehicles || new Map();
138136

139-
console.log({ options });
140-
141137
vehicles.forEach((vehicle) => {
142138
numberOfUpdatesInSession++;
143139

0 commit comments

Comments
 (0)