aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--widgets/account.go8
-rw-r--r--widgets/dirlist.go1
-rw-r--r--widgets/dirtree.go1
3 files changed, 6 insertions, 4 deletions
diff --git a/widgets/account.go b/widgets/account.go
index 0c2ce7d6..e9c86504 100644
--- a/widgets/account.go
+++ b/widgets/account.go
@@ -299,7 +299,8 @@ func (acct *AccountView) onMessage(msg types.WorkerMessage) {
}
case *types.ListDirectories:
acct.dirlist.Update(msg)
- if acct.dirlist.Selected() != "" {
+ if dir := acct.dirlist.Selected(); dir != "" {
+ acct.dirlist.Select(dir)
return
}
// Nothing selected, select based on config
@@ -321,7 +322,10 @@ func (acct *AccountView) onMessage(msg types.WorkerMessage) {
acct.newConn = true
}
case *types.Directory:
- store := acct.newStore(msg.Dir.Name)
+ store, ok := acct.dirlist.MsgStore(msg.Dir.Name)
+ if !ok {
+ store = acct.newStore(msg.Dir.Name)
+ }
acct.dirlist.SetMsgStore(msg.Dir, store)
case *types.DirectoryInfo:
acct.dirlist.Update(msg)
diff --git a/widgets/dirlist.go b/widgets/dirlist.go
index 788e197f..7d427dcc 100644
--- a/widgets/dirlist.go
+++ b/widgets/dirlist.go
@@ -169,7 +169,6 @@ func (dirlist *DirectoryList) Select(name string) {
switch msg.(type) {
case *types.Error:
dirlist.selecting = ""
- dirlist.selected = ""
case *types.Done:
dirlist.selected = dirlist.selecting
dirlist.filterDirsByFoldersConfig()
diff --git a/widgets/dirtree.go b/widgets/dirtree.go
index 027a8747..035a0a81 100644
--- a/widgets/dirtree.go
+++ b/widgets/dirtree.go
@@ -44,7 +44,6 @@ func (dt *DirectoryTree) OnVirtualNode(cb func()) {
func (dt *DirectoryTree) ClearList() {
dt.list = make([]*types.Thread, 0)
- dt.selected = ""
}
func (dt *DirectoryTree) Update(msg types.WorkerMessage) {