Skip to content

Commit

Permalink
fix(agent): (hopefully) get some memory savings in sensors table display
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuar committed Sep 26, 2023
1 parent c6fd675 commit 8efbd0b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion internal/agent/ui/fyneUI.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,12 @@ func (ui *fyneUI) sensorsWindow(s Agent, t *translations.Translator) fyne.Window

getValue := func(n string) string {
if v, err := s.SensorValue(n); err == nil {
return fmt.Sprintf("%v %s", v.State(), v.Units())
var b strings.Builder
fmt.Fprintf(&b, "%v", v.State())
if v.Units() != "" {
fmt.Fprintf(&b, " %s", v.Units())
}
return b.String()
}
return ""
}
Expand Down

0 comments on commit 8efbd0b

Please sign in to comment.