Start using the new synchronous stopSync method

This commit is contained in:
Stefan Ceriu
2023-05-24 14:33:56 +03:00
committed by Stefan Ceriu
parent 9c1c51645f
commit caa4abe659
3 changed files with 8 additions and 23 deletions
@@ -554,14 +554,13 @@ class AppCoordinator: AppCoordinatorProtocol, AuthenticationCoordinatorDelegate,
backgroundTask = backgroundTaskService.startBackgroundTask(withName: "SuspendApp: \(UUID().uuidString)") { [weak self] in
guard let self else { return }
userSession?.clientProxy.stopSync {
// No need to weakify self, this is a non escaping closure
self.backgroundTask?.stop()
self.backgroundTask = nil
self.backgroundAppRefreshTask?.setTaskCompleted(success: true)
self.backgroundAppRefreshTask = nil
}
userSession?.clientProxy.stopSync()
backgroundTask?.stop()
backgroundTask = nil
backgroundAppRefreshTask?.setTaskCompleted(success: true)
backgroundAppRefreshTask = nil
}
isSuspended = true