Skip to content

Commit

Permalink
Stopping the AV Session on a detached thread (#582)
Browse files Browse the repository at this point in the history
  • Loading branch information
rommex authored Jun 18, 2024
1 parent 5b37296 commit 8700cae
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,12 @@ extension QRScannerViewPresenter: QRScannerViewPresenterProtocol {
guard let view = self.view else { return }

UDVibration.buttonTap.vibrate()
Task {
view.stopCaptureSession()
Task.detached(priority: .background) { [weak self] in
guard let self else { return }
await view.stopCaptureSession()
await UDRouter().showConnectedAppsListScreen(in: view)
showNumberOfAppsConnected()
view.startCaptureSession()
await showNumberOfAppsConnected()
await view.startCaptureSession()
}
}

Expand Down

0 comments on commit 8700cae

Please sign in to comment.