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

Minor cleanup in HIBP module

This commit is contained in:
Chris Cummer 2019-09-26 18:10:44 -07:00
parent 555a1c6def
commit 11a8f396b7

View File

@ -67,16 +67,18 @@ func (widget *Widget) content() (string, string, bool) {
if widget.err != nil { if widget.err != nil {
return title, widget.err.Error(), true return title, widget.err.Error(), true
} }
title = title + widget.sinceDateForTitle() title = title + widget.sinceDateForTitle()
str := "" str := ""
for _, stat := range widget.data { for _, status := range widget.data {
color := widget.settings.colors.ok color := widget.settings.colors.ok
if stat.HasBeenCompromised() {
if status.HasBeenCompromised() {
color = widget.settings.colors.pwned color = widget.settings.colors.pwned
} }
str += fmt.Sprintf(" [%s]%s[white]\n", color, stat.Account) str += fmt.Sprintf(" [%s]%s[white]\n", color, status.Account)
} }
return title, str, false return title, str, false