1
0
mirror of https://github.com/taigrr/wtf synced 2025-01-18 04:03:14 -08:00

Merge branch 'master' into gcal-until-update

This commit is contained in:
Chris Cummer 2018-06-20 10:40:55 -07:00 committed by GitHub
commit e22d3c4fe4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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()
}
case <-widget.ch:
break outer
}