Skip to content

Commit

Permalink
fix: don't rate trips under 90 seconds
Browse files Browse the repository at this point in the history
  • Loading branch information
afonsosousah committed Jan 27, 2024
1 parent 3af8ef6 commit 862eaac
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions scripts/bikes.js
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,9 @@ function openRateTripMenu(tripObj) {
// Only keeps the hours and minutes (first 2 elements)
const formattedTime = elapsedTime.toLocaleTimeString("pt").split(":", 2).join();

// Don't rate trips under 90 seconds
if (elapsedTime < 90 * 1000) return;

// Show the rate trip menu
appendElementToBodyFromHTML(`
<div class="rate-trip-menu" id="rateTripMenu">
Expand Down

0 comments on commit 862eaac

Please sign in to comment.