pEpForiOS/UI/EmailDisplay/EmailListViewController.swift
changeset 2697 a9130d482e40
parent 2687 bb1dcce7a0d6
child 2715 50b73f5ea496
     1.1 --- a/pEpForiOS/UI/EmailDisplay/EmailListViewController.swift	Thu Aug 10 16:32:20 2017 +0200
     1.2 +++ b/pEpForiOS/UI/EmailDisplay/EmailListViewController.swift	Thu Aug 10 16:57:18 2017 +0200
     1.3 @@ -112,7 +112,10 @@
     1.4              performSegue(withIdentifier:.segueAddNewAccount, sender: self)
     1.5          }
     1.6  
     1.7 -        self.title = config?.folder?.realName
     1.8 +        guard let folder = config?.folder else {
     1.9 +            return
    1.10 +        }
    1.11 +        self.title = realName(of: folder)
    1.12      }
    1.13  
    1.14      func addSearchBar() {
    1.15 @@ -128,7 +131,6 @@
    1.16          tableView.reloadData()
    1.17      }
    1.18  
    1.19 -
    1.20      @IBAction func showUnreadButtonTapped(_ sender: UIBarButtonItem) {
    1.21          if let vm = viewModel {
    1.22              if vm.filterEnabled {
    1.23 @@ -148,8 +150,16 @@
    1.24              }
    1.25              self.textFilterButton.isEnabled = vm.filterEnabled
    1.26          }
    1.27 +    }
    1.28  
    1.29 +    // MARK: - Private
    1.30  
    1.31 +    private func realName(of folder: Folder) -> String? {
    1.32 +        if folder.isUnified {
    1.33 +            return folder.name
    1.34 +        } else {
    1.35 +            return folder.realName
    1.36 +        }
    1.37      }
    1.38  
    1.39      // MARK: - UI State