From 59cd554e037c5fda9d4fe5fe545848e550a7c77c Mon Sep 17 00:00:00 2001 From: Brian Buller Date: Tue, 9 Mar 2021 09:10:34 -0600 Subject: [PATCH] Fix bug in i3status - active timer --- model.go | 2 +- timer_ops.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/model.go b/model.go index a04c022..4b25227 100644 --- a/model.go +++ b/model.go @@ -13,7 +13,7 @@ import ( // Return the most recent done from timer.txt or dont.txt func (a *AppState) getMostRecentTimer() (*timertxt.Timer, error) { work, wErr := a.TimerList.GetMostRecentTimer() - if wErr != nil && work.FinishDate.IsZero() { + if wErr == nil && work.FinishDate.IsZero() { return work, nil } diff --git a/timer_ops.go b/timer_ops.go index a29c3f4..35181fe 100644 --- a/timer_ops.go +++ b/timer_ops.go @@ -18,7 +18,7 @@ func (a *AppState) opI3Status(args []string) int { return 0 } var text string - if !wrk.Finished { + if wrk.FinishDate.IsZero() { wrkDur := wrk.Duration().Round(time.Minute * 15) hrs := int(wrkDur.Hours()) mins := int(wrkDur.Minutes()) - hrs*60