We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7b869aa commit 12fcf48Copy full SHA for 12fcf48
1 file changed
src/frontend/src/Components/data/routes.js
@@ -187,6 +187,9 @@ export const shortenToOneDecimal = (num) => {
187
}
188
189
export const compareRoutes = (route1, route2) => {
190
+ if (!route1 && !route2) return true; // Return true if both routes are null
191
+ if (!route1 || !route2) return false; // Return false if only one route is null
192
+
193
return shortenToOneDecimal(route1.distance) === shortenToOneDecimal(route2.distance)
194
195
0 commit comments