From e5fe5ab175c4216ee7f8f5987e71a0021774c670 Mon Sep 17 00:00:00 2001 From: Marc Rousavy Date: Thu, 3 Jun 2021 15:41:43 +0200 Subject: [PATCH] fix: async dispatch conditional --- ios/CameraView.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ios/CameraView.swift b/ios/CameraView.swift index 4b8878c..98c039f 100644 --- a/ios/CameraView.swift +++ b/ios/CameraView.swift @@ -197,8 +197,8 @@ public final class CameraView: UIView { } // This is a wack workaround, but if I immediately set torch mode after `startRunning()`, the session isn't quite ready yet and will ignore torch. - self.cameraQueue.asyncAfter(deadline: .now() + 0.1) { - if shouldUpdateTorch { + if shouldUpdateTorch { + self.cameraQueue.asyncAfter(deadline: .now() + 0.1) { self.setTorchMode(self.torch) } }