Skip to content

Commit

Permalink
made save() called when next-timer() called without stoping timer (#7)
Browse files Browse the repository at this point in the history
* made save() called when next-timer() called without stoping timer

Co-authored-by: Renato Alves <alves.rjc@gmail.com>
  • Loading branch information
imenyoo2 and unode committed Sep 5, 2022
1 parent e089498 commit 1ec5241
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions polypomo
Original file line number Diff line number Diff line change
Expand Up @@ -139,12 +139,14 @@ class Status:
self.timer.change(op, seconds)

def next_timer(self):
self.active = False

if self.status == "work":
if self.active:
self.active = False
self.save() # save before switching if toggle didn't get called
self.status = "break"
self.timer = Timer(self.breaktime)
elif self.status == "break":
self.active = False
self.status = "work"
self.timer = Timer(self.worktime)

Expand Down

0 comments on commit 1ec5241

Please sign in to comment.