diff options
author | Koni Marti <koni.marti@gmail.com> | 2022-09-29 00:24:56 +0200 |
---|---|---|
committer | Robin Jarry <robin@jarry.cc> | 2022-09-29 16:52:12 +0200 |
commit | 0e50f29bf3e2cde36b2c345addbc51527b17e14b (patch) | |
tree | 98d470a98d887e7e2513a8f1d05541698c7cf35d /widgets/dirlist.go | |
parent | 684ceed2cdc66b34f8dcae97c641778c7117bb66 (diff) | |
download | aerc-0e50f29bf3e2cde36b2c345addbc51527b17e14b.tar.gz |
notmuch: move logic for dynamic folders to backend
Moves logic for creating dynamic folders from the dirlist widget to the
backend. Since dynamic folders are notmuch-specific, the notmuch backend
should be responsible for correctly setting up those folders. It does
that by sending two DirectoryInfos: the first to create the message
store, the second to fetch the directory content.
This approach also fixes a deadlock introduced by 716ade8968715
("worker: lock access to callback maps").
Reported-by: Bence Ferdinandy <bence@ferdinandy.com>
Signed-off-by: Koni Marti <koni.marti@gmail.com>
Tested-by: Tim Culverhouse <tim@timculverhouse.com>
Diffstat (limited to 'widgets/dirlist.go')
-rw-r--r-- | widgets/dirlist.go | 13 |
1 files changed, 0 insertions, 13 deletions
diff --git a/widgets/dirlist.go b/widgets/dirlist.go index 83001b7b..643be44a 100644 --- a/widgets/dirlist.go +++ b/widgets/dirlist.go @@ -156,12 +156,6 @@ func (dirlist *DirectoryList) Select(name string) { select { case <-time.After(delay): - newStore := true - for _, s := range dirlist.store.List() { - if s == dirlist.selecting { - newStore = false - } - } dirlist.worker.PostAction(&types.OpenDirectory{Directory: name}, func(msg types.WorkerMessage) { switch msg.(type) { @@ -185,13 +179,6 @@ func (dirlist *DirectoryList) Select(name string) { sort.Strings(dirlist.dirs) } dirlist.sortDirsByFoldersSortConfig() - if newStore { - store, ok := dirlist.MsgStore(name) - if ok { - // Fetch directory contents via store.Sort - store.Sort(nil, nil) - } - } } dirlist.Invalidate() }) |