Skip to content

Commit

Permalink
fix issue on clicking previous on day 1
Browse files Browse the repository at this point in the history
  • Loading branch information
DevangThakkar committed Jan 12, 2022
1 parent 6162e5d commit fa1c4a1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -290,11 +290,13 @@ function App() {
play()
}
const playPrevious = () => {
day = day - 1
if (day > 1) {
day = day - 1
}
play()
}
const playRandom = () => {
day = Math.floor(Math.random() * og_day)
day = Math.floor(Math.random() * (og_day-1))+1
play()
}
const playNext = () => {
Expand Down

0 comments on commit fa1c4a1

Please sign in to comment.