Fix bug in i3status - active timer

This commit is contained in:
Brian Buller 2021-03-09 09:10:34 -06:00
parent 2b357839e9
commit 59cd554e03
2 changed files with 2 additions and 2 deletions

View File

@ -13,7 +13,7 @@ import (
// Return the most recent done from timer.txt or dont.txt // Return the most recent done from timer.txt or dont.txt
func (a *AppState) getMostRecentTimer() (*timertxt.Timer, error) { func (a *AppState) getMostRecentTimer() (*timertxt.Timer, error) {
work, wErr := a.TimerList.GetMostRecentTimer() work, wErr := a.TimerList.GetMostRecentTimer()
if wErr != nil && work.FinishDate.IsZero() { if wErr == nil && work.FinishDate.IsZero() {
return work, nil return work, nil
} }

View File

@ -18,7 +18,7 @@ func (a *AppState) opI3Status(args []string) int {
return 0 return 0
} }
var text string var text string
if !wrk.Finished { if wrk.FinishDate.IsZero() {
wrkDur := wrk.Duration().Round(time.Minute * 15) wrkDur := wrk.Duration().Round(time.Minute * 15)
hrs := int(wrkDur.Hours()) hrs := int(wrkDur.Hours())
mins := int(wrkDur.Minutes()) - hrs*60 mins := int(wrkDur.Minutes()) - hrs*60