IOS-1495 self delete handled IOS-1521+IOS-1495
authorXavier Algarra <xavier@pep-project.org>
Tue, 14 May 2019 16:16:52 +0200
branchIOS-1521+IOS-1495
changeset 86236af6c7564b3b
parent 8620 81e20eeddbe0
child 8624 d25425528e65
IOS-1495 self delete handled
pEpForiOS/UI/EmailDisplayList/EmailListViewModel+MessageQueryResultsDelegate.swift
pEpForiOS/UI/EmailDisplayList/EmailListViewModel.swift
     1.1 --- a/pEpForiOS/UI/EmailDisplayList/EmailListViewModel+MessageQueryResultsDelegate.swift	Wed May 15 10:47:37 2019 +0200
     1.2 +++ b/pEpForiOS/UI/EmailDisplayList/EmailListViewModel+MessageQueryResultsDelegate.swift	Tue May 14 16:16:52 2019 +0200
     1.3 @@ -24,7 +24,9 @@
     1.4      }
     1.5  
     1.6      func didDelete(indexPath: IndexPath) {
     1.7 +        if !deleteDisabled {
     1.8              emailListViewModelDelegate?.emailListViewModel(viewModel: self, didRemoveDataAt: [indexPath])
     1.9 +        }
    1.10      }
    1.11  
    1.12      func didMove(from: IndexPath, to: IndexPath) {
     2.1 --- a/pEpForiOS/UI/EmailDisplayList/EmailListViewModel.swift	Wed May 15 10:47:37 2019 +0200
     2.2 +++ b/pEpForiOS/UI/EmailDisplayList/EmailListViewModel.swift	Tue May 14 16:16:52 2019 +0200
     2.3 @@ -51,6 +51,7 @@
     2.4  
     2.5      var lastSearchTerm = ""
     2.6      var updatesEnabled = true
     2.7 +    var deleteDisabled = false
     2.8  
     2.9      public var emailListViewModelDelegate: EmailListViewModelDelegate?
    2.10  
    2.11 @@ -296,6 +297,7 @@
    2.12      }
    2.13  
    2.14      func delete(forIndexPath indexPath: IndexPath) {
    2.15 +        deleteDisabled = true
    2.16          let _ = deleteMessage(at: indexPath)
    2.17      }
    2.18