diff options
Diffstat (limited to 'widgets/account.go')
-rw-r--r-- | widgets/account.go | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/widgets/account.go b/widgets/account.go index ecf357e9..d4a74ce8 100644 --- a/widgets/account.go +++ b/widgets/account.go @@ -232,7 +232,7 @@ func (acct *AccountView) isSelected() bool { func (acct *AccountView) newStore(name string) *lib.MessageStore { uiConf := acct.dirlist.UiConfig(name) store := lib.NewMessageStore(acct.worker, - acct.GetSortCriteria(), + acct.sortCriteria(uiConf), uiConf.ThreadingEnabled, uiConf.ForceClientThreads, uiConf.ClientThreadsDelay, @@ -422,11 +422,14 @@ func (acct *AccountView) updateDirCounts(destination string, uids []uint32) { } } -func (acct *AccountView) GetSortCriteria() []*types.SortCriterion { - if len(acct.UiConfig().Sort) == 0 { +func (acct *AccountView) sortCriteria(uiConf *config.UIConfig) []*types.SortCriterion { + if uiConf == nil { + return nil + } + if len(uiConf.Sort) == 0 { return nil } - criteria, err := sort.GetSortCriteria(acct.UiConfig().Sort) + criteria, err := sort.GetSortCriteria(uiConf.Sort) if err != nil { acct.PushError(fmt.Errorf("ui sort: %w", err)) return nil @@ -434,6 +437,10 @@ func (acct *AccountView) GetSortCriteria() []*types.SortCriterion { return criteria } +func (acct *AccountView) GetSortCriteria() []*types.SortCriterion { + return acct.sortCriteria(acct.UiConfig()) +} + func (acct *AccountView) CheckMail() { acct.Lock() defer acct.Unlock() |