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

Display a msg if no one is on call for a schedule

This commit is contained in:
Chris Cummer 2018-04-03 16:41:24 -07:00 committed by Chris Cummer
parent faa4a915c4
commit a4a94f2984

View File

@ -61,7 +61,13 @@ func (widget *Widget) contentFrom(onCallResponse *OnCallResponse) string {
for _, data := range onCallResponse.OnCallData {
str = str + fmt.Sprintf(" [green]%s[white]\n", widget.cleanScheduleName(data.Parent.Name))
if len(data.Recipients) == 0 {
str = str + " [gray]no one[white]\n"
} else {
str = str + fmt.Sprintf(" %s\n", strings.Join(widget.namesFromEmails(data.Recipients), ", "))
}
str = str + "\n"
}