mirror of
https://github.com/taigrr/wtf
synced 2025-01-18 04:03:14 -08:00
fix tie color
This commit is contained in:
parent
d48a3a6d8c
commit
f334604071
2
main.go
2
main.go
@ -41,6 +41,7 @@ import (
|
||||
"github.com/wtfutil/wtf/modules/jenkins"
|
||||
"github.com/wtfutil/wtf/modules/jira"
|
||||
"github.com/wtfutil/wtf/modules/mercurial"
|
||||
"github.com/wtfutil/wtf/modules/nbascore"
|
||||
"github.com/wtfutil/wtf/modules/newrelic"
|
||||
"github.com/wtfutil/wtf/modules/opsgenie"
|
||||
"github.com/wtfutil/wtf/modules/pagerduty"
|
||||
@ -63,7 +64,6 @@ import (
|
||||
"github.com/wtfutil/wtf/modules/weatherservices/prettyweather"
|
||||
"github.com/wtfutil/wtf/modules/weatherservices/weather"
|
||||
"github.com/wtfutil/wtf/modules/zendesk"
|
||||
"github.com/wtfutil/wtf/modules/nbascore"
|
||||
"github.com/wtfutil/wtf/wtf"
|
||||
)
|
||||
|
||||
|
@ -36,7 +36,7 @@ func NewWidget(app *tview.Application, pages *tview.Pages) *Widget {
|
||||
TextWidget: wtf.NewTextWidget(app, "NBA Score", "nbascore", true),
|
||||
}
|
||||
widget.HelpfulWidget.SetView(widget.View)
|
||||
widget.TextWidget.RefreshInt = 5
|
||||
widget.TextWidget.RefreshInt = 15
|
||||
widget.View.SetInputCapture(widget.keyboardIntercept)
|
||||
widget.View.SetScrollable(true)
|
||||
return &widget
|
||||
@ -67,7 +67,7 @@ func (widget *Widget) nbascore() {
|
||||
if response.StatusCode != 200 {
|
||||
widget.result = err.Error()
|
||||
return
|
||||
} // Get data from data.nba.net and check if successful
|
||||
} // Get data from data.nba.net and check if successful
|
||||
|
||||
contents, err := ioutil.ReadAll(response.Body)
|
||||
if err != nil {
|
||||
@ -108,16 +108,17 @@ func (widget *Widget) nbascore() {
|
||||
}
|
||||
vNum, _ := strconv.Atoi(vScore)
|
||||
hNum, _ := strconv.Atoi(hScore)
|
||||
hColor := ""
|
||||
hColor := ""
|
||||
if quarter != 0 { // Compare the score
|
||||
if vNum > hNum {
|
||||
vTeam = "[orange]" + vTeam
|
||||
} else if hNum > vNum {
|
||||
// hScore = "[orange]" + hScore
|
||||
hColor = "[orange]" // For correct padding
|
||||
hColor = "[orange]" // For correct padding
|
||||
hTeam = hTeam + "[white]"
|
||||
} else {
|
||||
vTeam = "[orange]" + vTeam
|
||||
hColor = "[orange]"
|
||||
hTeam = hTeam + "[white]"
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user