merge IOS-1495 refactor
authorXavier Algarra <xavier@pep-project.org>
Wed, 22 May 2019 14:51:22 +0200
branchrefactor
changeset 8727fc81e2e79970
parent 8725 dceb7f2f3251
parent 8726 e9e62faa9f4f
child 8731 8756c7e28898
child 8732 3b7bd4f072bc
child 8736 ec061f625c49
merge IOS-1495
     1.1 --- a/pEpForiOS/UI/EmailDisplayList/EmailListViewController.swift	Wed May 22 14:23:14 2019 +0200
     1.2 +++ b/pEpForiOS/UI/EmailDisplayList/EmailListViewController.swift	Wed May 22 14:51:22 2019 +0200
     1.3 @@ -61,7 +61,6 @@
     1.4          }
     1.5  
     1.6          setUpTextFilter()
     1.7 -        // Mark this folder as having been looked at by the user
     1.8  
     1.9          guard let vm = model else {
    1.10              Log.shared.errorAndCrash("No VM")
    1.11 @@ -99,6 +98,7 @@
    1.12  
    1.13          if vm.showLoginView {
    1.14              showLoginScreen()
    1.15 +            return
    1.16          }
    1.17  
    1.18          ///if we are in setup and the folder is unifiedInbox
    1.19 @@ -249,13 +249,6 @@
    1.20  
    1.21          showEditToolbar()
    1.22          tableView.setEditing(true, animated: true)
    1.23 -
    1.24 -        //!!!: English is the ONLY used language in our code base
    1.25 -        //modificar toolbar
    1.26 -        //hacer aparecer check de marcado
    1.27 -        //hacer la accion solicitada
    1.28 -        //recuperar toolbar
    1.29 -
    1.30      }
    1.31  
    1.32      private func showEditToolbar() {
    1.33 @@ -699,6 +692,15 @@
    1.34  // MARK: - EmailListViewModelDelegate
    1.35  
    1.36  extension EmailListViewController: EmailListViewModelDelegate {
    1.37 +    func checkIfSplitNeedsUpdate(indexpath: [IndexPath]) {
    1.38 +        guard let isIphone = splitViewController?.isCollapsed, let last = lastSelectedIndexPath else {
    1.39 +            return
    1.40 +        }
    1.41 +        if !isIphone && indexpath.contains(last) {
    1.42 +            showEmail(forCellAt: last)
    1.43 +        }
    1.44 +    }
    1.45 +
    1.46      func reloadData(viewModel: EmailListViewModel) {
    1.47          tableView.reloadData()
    1.48      }
     2.1 --- a/pEpForiOS/UI/EmailDisplayList/EmailListViewModel+MessageQueryResultsDelegate.swift	Wed May 22 14:23:14 2019 +0200
     2.2 +++ b/pEpForiOS/UI/EmailDisplayList/EmailListViewModel+MessageQueryResultsDelegate.swift	Wed May 22 14:51:22 2019 +0200
     2.3 @@ -21,6 +21,7 @@
     2.4          if updatesEnabled {
     2.5              emailListViewModelDelegate?.emailListViewModel(viewModel: self, didUpdateDataAt: [indexPath])
     2.6          }
     2.7 +        emailListViewModelDelegate?.checkIfSplitNeedsUpdate(indexpath: [indexPath])
     2.8      }
     2.9  
    2.10      func didDelete(indexPath: IndexPath) {
     3.1 --- a/pEpForiOS/UI/EmailDisplayList/EmailListViewModel.swift	Wed May 22 14:23:14 2019 +0200
     3.2 +++ b/pEpForiOS/UI/EmailDisplayList/EmailListViewModel.swift	Wed May 22 14:51:22 2019 +0200
     3.3 @@ -19,6 +19,7 @@
     3.4      func emailListViewModel(viewModel: EmailListViewModel, didRemoveDataAt indexPaths: [IndexPath])
     3.5      func emailListViewModel(viewModel: EmailListViewModel,
     3.6                              didMoveData atIndexPath: IndexPath, toIndexPath: IndexPath)
     3.7 +    func checkIfSplitNeedsUpdate(indexpath: [IndexPath])
     3.8      /*
     3.9       //!!!: Some issues here:
    3.10       - bad naming.