aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--widgets/account.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/widgets/account.go b/widgets/account.go
index 647a3aee..5d1315c2 100644
--- a/widgets/account.go
+++ b/widgets/account.go
@@ -32,6 +32,7 @@ type AccountView struct {
msglist *MessageList
worker *types.Worker
state *statusline.State
+ update bool
}
func (acct *AccountView) UiConfig() config.UIConfig {
@@ -113,6 +114,7 @@ func (acct *AccountView) SetStatus(setters ...statusline.SetStateFunc) {
for _, fn := range setters {
fn(acct.state)
}
+ acct.update = true
}
func (acct *AccountView) UpdateStatus() {
@@ -158,7 +160,10 @@ func (acct *AccountView) Invalidate() {
}
func (acct *AccountView) Draw(ctx *ui.Context) {
- acct.UpdateStatus()
+ if acct.update {
+ acct.UpdateStatus()
+ acct.update = false
+ }
acct.grid.Draw(ctx)
}