Skip to content

Commit

Permalink
fix: do not reset round count after a pause
Browse files Browse the repository at this point in the history
  • Loading branch information
jac18281828 committed Nov 17, 2024
1 parent bfd1ec6 commit e3420f4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ pub struct App {
impl App {
fn start(&mut self, ctx: &Context<Self>) {
self.cancel(); // Cancel any existing timeout
self.timer.current_round = 1;
if self.timer.current_round >= self.timer.rounds {
self.timer.current_round = 1;
}
let start_time = Date::now();
self.next_tick_time = start_time + 100.0; // Schedule first tick after 100ms
self.timer.running = true;
Expand Down

0 comments on commit e3420f4

Please sign in to comment.