aerc

Working clone of aerc-mail.org
git clone git://git.danielmoch.com/aerc.git
Log | Files | Refs | README | LICENSE

commit 4ec7f5dea5f98ef5a8cddb84986ac52a2f7a1270
parent 62946ff6c5712bebf7f07a83fc077d40db0e73a8
Author: Drew DeVault <sir@cmpwn.com>
Date:   Thu, 14 Mar 2019 22:41:43 -0400

Use cached message store when re-opening dirs

Diffstat:
Mwidgets/account.go | 10+++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/widgets/account.go b/widgets/account.go @@ -177,7 +177,15 @@ func (acct *AccountView) onMessage(msg types.WorkerMessage) { case *types.Done: switch msg.InResponseTo().(type) { case *types.OpenDirectory: - acct.msglist.SetStore(nil) + if store, ok := acct.msgStores[acct.dirlist.selected]; ok { + // If we've opened this dir before, we can re-render it from + // memory while we wait for the update and the UI feels + // snappier. If not, we'll unset the store and show the spinner + // while we download the UID list. + acct.msglist.SetStore(store) + } else { + acct.msglist.SetStore(nil) + } acct.worker.PostAction(&types.FetchDirectoryContents{}, func(msg types.WorkerMessage) { store := acct.msgStores[acct.dirlist.selected]