Skip to content

Commit

Permalink
fix: filter out locked docks
Browse files Browse the repository at this point in the history
  • Loading branch information
ImRodry committed Apr 24, 2024
1 parent 9b7c191 commit 737fb65
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/stations.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ async function openStationMenu(stationSerialNumber) {
stationObj.bikeList = bikeAndDocks.getBikes;
stationObj.dockList = bikeAndDocks.getDocks;
const numBikes = stationObj.bikeList.length;
const numDocks = stationObj.docks - numBikes; // number of free docks
const numDocks = stationObj.dockList.filter(d => d.lockStatus === "unlocked").length - numBikes; // number of free docks

// set the inner HTML after the animation has started
if (typeof bikeAndDocks.getBikes !== "undefined" && typeof bikeAndDocks.getDocks !== "undefined") {
Expand Down

0 comments on commit 737fb65

Please sign in to comment.