From 55e84533022c1f9bf9fd9e2cd2db930394b590b8 Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Wed, 10 Jan 2018 22:54:55 -0500 Subject: Improve invalidation logic --- ui/account.go | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'ui/account.go') diff --git a/ui/account.go b/ui/account.go index 0949e524..9c16cc57 100644 --- a/ui/account.go +++ b/ui/account.go @@ -11,6 +11,8 @@ type AccountTab struct { Config *config.AccountConfig Worker *worker.Worker Parent *UIState + + counter int } func NewAccountTab(conf *config.AccountConfig, work *worker.Worker) *AccountTab { @@ -24,10 +26,6 @@ func (acc *AccountTab) Name() string { return acc.Config.Name } -func (acc *AccountTab) Invalid() bool { - return false -} - func (acc *AccountTab) SetParent(parent *UIState) { acc.Parent = parent } @@ -37,5 +35,10 @@ func (acc *AccountTab) Render(at Geometry) { Fg: tb.ColorDefault, Bg: tb.ColorDefault, } - TPrintf(&at, cell, "%s", acc.Name()) + TPrintf(&at, cell, "%s %d", acc.Name(), acc.counter) + acc.counter++ + if acc.counter%10000 == 0 { + acc.counter = 0 + } + acc.Parent.InvalidateFrom(acc) } -- cgit