1
0
mirror of https://github.com/taigrr/wtf synced 2026-03-22 20:32:18 -07:00

Handle offline scenarios for OpsGenie

This commit is contained in:
Chris Cummer
2018-04-09 09:48:45 -07:00
committed by Chris Cummer
parent 204e3b4032
commit aa658db210
6 changed files with 46 additions and 32 deletions

View File

@@ -34,13 +34,20 @@ func (widget *Widget) Refresh() {
return
}
data := Fetch()
data, err := Fetch()
widget.View.SetTitle(" ⏰ On Call ")
widget.RefreshedAt = time.Now()
widget.View.Clear()
fmt.Fprintf(widget.View, "%s", widget.contentFrom(data))
if err != nil {
widget.View.SetWrap(true)
fmt.Fprintf(widget.View, "%s", err)
} else {
widget.View.SetWrap(false)
fmt.Fprintf(widget.View, "%s", widget.contentFrom(data))
}
}
/* -------------------- Unexported Functions -------------------- */