From 8700cae92de6bd7f01abb5c2496a48013187ce30 Mon Sep 17 00:00:00 2001 From: rommex Date: Tue, 18 Jun 2024 14:33:14 +0300 Subject: [PATCH] Stopping the AV Session on a detached thread (#582) --- .../Modules/QRScanner/QRScannerViewPresenter.swift | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/unstoppable-ios-app/domains-manager-ios/Modules/QRScanner/QRScannerViewPresenter.swift b/unstoppable-ios-app/domains-manager-ios/Modules/QRScanner/QRScannerViewPresenter.swift index 028b4ca34..c8506b014 100644 --- a/unstoppable-ios-app/domains-manager-ios/Modules/QRScanner/QRScannerViewPresenter.swift +++ b/unstoppable-ios-app/domains-manager-ios/Modules/QRScanner/QRScannerViewPresenter.swift @@ -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() } }