Fix bug if no timers in timers.txt

Also go mod
This commit is contained in:
Brian Buller 2021-04-05 07:57:53 -05:00
parent 59cd554e03
commit 901015f211
3 changed files with 27 additions and 1 deletions

12
go.mod Normal file
View File

@ -0,0 +1,12 @@
module git.bullercodeworks.com/brian/gime
go 1.16
require (
git.bullercodeworks.com/brian/go-timertxt v0.0.0-20210302170637-d35b67037e23
github.com/BurntSushi/toml v0.3.1 // indirect
github.com/br0xen/termbox-util v0.0.0-20200220160819-dc6d6950ba00
github.com/br0xen/user-config v0.0.0-20170914134719-16e743ec93a2
github.com/casimir/xdg-go v0.0.0-20160329195404-372ccc2180da // indirect
github.com/nsf/termbox-go v1.1.0
)

14
go.sum Normal file
View File

@ -0,0 +1,14 @@
git.bullercodeworks.com/brian/go-timertxt v0.0.0-20210302170637-d35b67037e23 h1:/Tug0iB9QbhMagmU484YmnBZ4GzyWpK2hpulB+wmW0A=
git.bullercodeworks.com/brian/go-timertxt v0.0.0-20210302170637-d35b67037e23/go.mod h1:y+bBvu2tRRBd6DpbrB/SlCITD7flInD5CYVYnaEZl3g=
github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/br0xen/termbox-util v0.0.0-20200220160819-dc6d6950ba00 h1:9AXfX20nYtpadSCppvKkZfFgU/htFHVhYqYdPNa4bm4=
github.com/br0xen/termbox-util v0.0.0-20200220160819-dc6d6950ba00/go.mod h1:x9wJlgOj74OFTOBwXOuO8pBguW37EgYNx51Dbjkfzo4=
github.com/br0xen/user-config v0.0.0-20170914134719-16e743ec93a2 h1:H/prDPxUZBsK4DQC7ScP3ftSijMtWyetb6ab69DSKrs=
github.com/br0xen/user-config v0.0.0-20170914134719-16e743ec93a2/go.mod h1:lMy7txIyYXt+I/1JgTGBZTdyTNJyNVDCX4Z+lHzNcSM=
github.com/casimir/xdg-go v0.0.0-20160329195404-372ccc2180da h1:hjpZV7G49m1bly++F+Gho1Sbf2+eBW/eTLJWuRkH9Uc=
github.com/casimir/xdg-go v0.0.0-20160329195404-372ccc2180da/go.mod h1:dywSSi3sMtJn2IjiYfJciP9tjVVeIVRa7AE7N5WLUBo=
github.com/mattn/go-runewidth v0.0.9 h1:Lm995f3rfxdpd6TSmuVCHVb/QhupuXlYr8sCI/QdE+0=
github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
github.com/nsf/termbox-go v1.1.0 h1:R+GIXVMaDxDQ2VHem5vO5h0mI8ZxLECTUNw1ZzXODzI=
github.com/nsf/termbox-go v1.1.0/go.mod h1:T0cTdVuOwf7pHQNtfhnEbzHbcNyCEcVU4YPpouCbVxo=

View File

@ -24,7 +24,7 @@ func (a *AppState) getMostRecentTimer() (*timertxt.Timer, error) {
if dErr != nil { if dErr != nil {
return nil, dErr return nil, dErr
} }
if !done.FinishDate.IsZero() && done.FinishDate.After(work.FinishDate) { if !done.FinishDate.IsZero() && work == nil || done.FinishDate.After(work.FinishDate) {
return done, nil return done, nil
} }
return work, nil return work, nil