IOS-1323 mark read: update master only on iPhone
authorbuff <andreas@pep-project.org>
Mon, 10 Sep 2018 15:09:36 +0200
changeset 63007ba3e48efada
parent 6299 fe6de4f17271
child 6301 d07245a10abe
IOS-1323 mark read: update master only on iPhone
pEpForiOS/UI/EmailDisplayList/EmailListViewController.swift
     1.1 --- a/pEpForiOS/UI/EmailDisplayList/EmailListViewController.swift	Mon Sep 10 14:25:04 2018 +0200
     1.2 +++ b/pEpForiOS/UI/EmailDisplayList/EmailListViewController.swift	Mon Sep 10 15:09:36 2018 +0200
     1.3 @@ -114,7 +114,7 @@
     1.4              // No account exists. Show account setup.
     1.5              performSegue(withIdentifier:.segueAddNewAccount, sender: self)
     1.6              return
     1.7 -        } else if let vm = model {
     1.8 +        } else if let vm = model { //IOS-1323 dead code. Remove. Not using this is actually causing  IOS-1323.
     1.9              // We came back from e.g EmailView ...
    1.10              updateFilterText()
    1.11              // ... so we want to update "seen" status
    1.12 @@ -755,7 +755,6 @@
    1.13  // MARK: - EmailListModelDelegate
    1.14  
    1.15  extension EmailListViewController: EmailListViewModelDelegate {
    1.16 -
    1.17      func showThreadView(for indexPath: IndexPath) {
    1.18          guard let splitViewController = splitViewController else {
    1.19              return
    1.20 @@ -867,6 +866,16 @@
    1.21          }
    1.22      }
    1.23  
    1.24 +    func emailListViewModel(viewModel: EmailListViewModel, didChangeSeenStateForDataAt indexPaths: [IndexPath]) {
    1.25 +        //IOS-1323:
    1.26 +        guard let displayMode = splitViewController?.displayMode, displayMode == .primaryHidden
    1.27 +            else {
    1.28 +                // We do not update the seen status when both spitview views are shown.
    1.29 +                return
    1.30 +        }
    1.31 +        emailListViewModel(viewModel: viewModel, didUpdateDataAt: indexPaths)
    1.32 +    }
    1.33 +
    1.34      func emailListViewModel(viewModel: EmailListViewModel,
    1.35                              didUpdateUndisplayedMessage message: Message) {
    1.36          // ignore