Suspend system activity in extensions. Issue #1427

This commit is contained in:
Maurice Parker 2019-12-14 15:44:57 -07:00
parent 1ae421d3c8
commit d870c4ffb3
2 changed files with 4 additions and 0 deletions

View File

@ -116,6 +116,8 @@ public class AddWebFeedIntentHandler: NSObject, AddWebFeedIntentHandling {
validAccount.createWebFeed(url: url.absoluteString, name: nil, container: validContainer) { result in validAccount.createWebFeed(url: url.absoluteString, name: nil, container: validContainer) { result in
switch result { switch result {
case .success: case .success:
AccountManager.shared.suspendNetworkAll()
AccountManager.shared.suspendDatabaseAll()
completion(AddWebFeedIntentResponse(code: .success, userActivity: nil)) completion(AddWebFeedIntentResponse(code: .success, userActivity: nil))
case .failure(let error): case .failure(let error):
switch error { switch error {

View File

@ -114,6 +114,8 @@ class ShareViewController: SLComposeServiceViewController, ShareFolderPickerCont
switch result { switch result {
case .success: case .success:
account!.save() account!.save()
AccountManager.shared.suspendNetworkAll()
AccountManager.shared.suspendDatabaseAll()
self.extensionContext!.completeRequest(returningItems: [], completionHandler: nil) self.extensionContext!.completeRequest(returningItems: [], completionHandler: nil)
case .failure(let error): case .failure(let error):
self.presentError(error) { self.presentError(error) {