Skip to content

Commit 848b230

Browse files
committed
fix: only start countdown after return
1 parent 36d2875 commit 848b230

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

scripts/bikes.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -428,12 +428,12 @@ async function tripTimer(startTime, isStarting) {
428428
function openRateTripMenu(tripObj) {
429429
// Calculate the trip time
430430
const endDate = Date.parse(tripObj.endDate);
431-
startCountdownBetweenTrips(endDate);
432431
const elapsedTime = endDate - Date.parse(tripObj.startDate);
433432
const formattedTime = parseMillisecondsIntoTripTime(elapsedTime, true);
434433

435434
// Don't rate trips under 90 seconds
436435
if (elapsedTime < 90 * 1000) return;
436+
startCountdownBetweenTrips(endDate);
437437

438438
// Set that there is a trip being rated (don't show any new ratings while this is true)
439439
tripBeingRated = true;

0 commit comments

Comments
 (0)