From 37bf94278867df04e5f5a926ccba9874041cc4e4 Mon Sep 17 00:00:00 2001 From: Chris Cummer Date: Wed, 20 Jun 2018 09:13:38 -0700 Subject: [PATCH 1/2] Add Twitter link to the README --- README.md | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/README.md b/README.md index 7f44cf69..bde638c1 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,5 @@ - - - -

- -

+ A personal terminal-based dashboard utility, designed for displaying infrequently-needed, but very important, daily data. From 9eabbd1691b40aff6e2737910bc7495751f88645 Mon Sep 17 00:00:00 2001 From: Chris Cummer Date: Wed, 20 Jun 2018 10:38:31 -0700 Subject: [PATCH 2/2] Move GCal item check closer to point of impact --- gcal/widget.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/gcal/widget.go b/gcal/widget.go index 1fce95b6..526ac5cc 100644 --- a/gcal/widget.go +++ b/gcal/widget.go @@ -49,6 +49,10 @@ func (widget *Widget) Disable() { /* -------------------- Unexported Functions -------------------- */ func (widget *Widget) display() { + if widget.events == nil || len(widget.events.Items) == 0 { + return + } + widget.mutex.Lock() defer widget.mutex.Unlock() widget.View.SetText(fmt.Sprintf("%s", widget.contentFrom(widget.events))) @@ -287,9 +291,7 @@ outer: for { select { case <-tick.C: - if widget.events != nil && len(widget.events.Items) > 0 { - widget.display() - } + widget.display() case <-widget.ch: break outer }