Skip to content

Commit

Permalink
Fix bug where clock would reset if time ended during back gesture
Browse files Browse the repository at this point in the history
  • Loading branch information
ldeso committed Jun 19, 2024
1 parent e717584 commit 6134ab9
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@

## 2.0.1 – Unreleased

### Bug Fix

- Fix bug where clock would reset if time ended during back gesture

### Note

- Switch links to HTTPS in README.md
Expand Down
1 change: 1 addition & 0 deletions metadata/en-US/changelogs/201.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
• Fix bug where clock would reset if time ended during back gesture
12 changes: 7 additions & 5 deletions src/main/kotlin/ui/ClockScreen.kt
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,13 @@ fun ClockScreen(
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {
delay(100L)
}
if (clockState == ClockState.TICKING) {
clockViewModel.pause()
clockViewModel.restore(isDecimalRestored = true)
} else {
clockViewModel.reset()
when (backEventAction) {
BackAction.PAUSE -> run {
clockViewModel.pause()
clockViewModel.restore(isDecimalRestored = true)
}

BackAction.RESET -> clockViewModel.reset()
}
},
updateSwipeEdge = { backEventSwipeEdge = it },
Expand Down

0 comments on commit 6134ab9

Please sign in to comment.