pEpForiOS/UI/EmailDisplay/EmailListViewController.swift
changeset 3161 b47f06f24dc1
parent 3111 97faecad8d57
child 3178 d0448c545cd1
     1.1 --- a/pEpForiOS/UI/EmailDisplay/EmailListViewController.swift	Wed Oct 04 17:05:18 2017 +0200
     1.2 +++ b/pEpForiOS/UI/EmailDisplay/EmailListViewController.swift	Wed Oct 04 14:24:43 2017 +0200
     1.3 @@ -55,12 +55,9 @@
     1.4          if MiscUtil.isUnitTest() {
     1.5              return
     1.6          }
     1.7 -
     1.8 -        if let vm = viewModel {
     1.9 -            self.textFilterButton.isEnabled = vm.filterEnabled
    1.10 -            updateFilterText()
    1.11 -        } else {
    1.12 -            self.textFilterButton.isEnabled = false
    1.13 +        if Account.all().isEmpty {
    1.14 +            performSegue(withIdentifier:.segueAddNewAccount, sender: self)
    1.15 +            return
    1.16          }
    1.17  
    1.18          setDefaultColors()
    1.19 @@ -102,14 +99,17 @@
    1.20                                       folder: Folder.unifiedInbox())
    1.21          }
    1.22  
    1.23 -        if Account.all().isEmpty {
    1.24 -            performSegue(withIdentifier:.segueAddNewAccount, sender: self)
    1.25 -        }
    1.26 -
    1.27          guard let folder = config?.folder else {
    1.28              return
    1.29          }
    1.30          self.title = realName(of: folder)
    1.31 +
    1.32 +        if let vm = viewModel {
    1.33 +            self.textFilterButton.isEnabled = vm.filterEnabled
    1.34 +            updateFilterText()
    1.35 +        } else {
    1.36 +            self.textFilterButton.isEnabled = false
    1.37 +        }
    1.38      }
    1.39  
    1.40      func addSearchBar() {
    1.41 @@ -159,7 +159,7 @@
    1.42      }
    1.43  
    1.44      func updateFilterText() {
    1.45 -        if let vm = viewModel, let txt = vm.enabledFilters?.text {
    1.46 +        if let vm = viewModel, let txt = vm.enabledFilters?.title {
    1.47              textFilterButton.title = "Filter by: " + txt
    1.48          }
    1.49      }