summaryrefslogtreecommitdiff
path: root/widgets
diff options
context:
space:
mode:
authorKoni Marti <koni.marti@gmail.com>2022-07-26 15:41:13 +0200
committerRobin Jarry <robin@jarry.cc>2022-07-26 22:22:48 +0200
commit54a0a377e03074a27d7d9e84092487c55761b510 (patch)
tree2c6bf66efa9f5e997eec8a3eb45d5d3f42dce349 /widgets
parenta1a549cb1e10d18e071695249b995e2dddfdac2a (diff)
downloadaerc-54a0a377e03074a27d7d9e84092487c55761b510.zip
threads: debounce client-side thread building
Debounce client-side thread building in the message store. Debouncing is useful when multiple messages are loaded, i.e. when scrolling with PgUp/PgDown. Without the debouncing, all client-side threads will be built everytime the message store is updated which creates a noticable lag in the message list ui when client-side threading is activated. The default debouncing delay can be changed by changing 'client-threads-delay' in the UI config section. Signed-off-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
Diffstat (limited to 'widgets')
-rw-r--r--widgets/account.go1
-rw-r--r--widgets/msglist.go1
2 files changed, 2 insertions, 0 deletions
diff --git a/widgets/account.go b/widgets/account.go
index ff51636..50b0fab 100644
--- a/widgets/account.go
+++ b/widgets/account.go
@@ -288,6 +288,7 @@ func (acct *AccountView) onMessage(msg types.WorkerMessage) {
acct.GetSortCriteria(),
acct.UiConfig().ThreadingEnabled,
acct.UiConfig().ForceClientThreads,
+ acct.UiConfig().ClientThreadsDelay,
func(msg *models.MessageInfo) {
acct.conf.Triggers.ExecNewEmail(acct.acct,
acct.conf, msg)
diff --git a/widgets/msglist.go b/widgets/msglist.go
index 4c7c1c2..95dfa1f 100644
--- a/widgets/msglist.go
+++ b/widgets/msglist.go
@@ -344,6 +344,7 @@ func (ml *MessageList) storeUpdate(store *lib.MessageStore) {
if ml.Store() != store {
return
}
+ ml.Invalidate()
}
func (ml *MessageList) SetStore(store *lib.MessageStore) {