From bd5c9675b7d47edc22dcafa3ee37fc520532a53f Mon Sep 17 00:00:00 2001 From: Marc Rousavy Date: Thu, 14 Dec 2023 10:54:19 +0100 Subject: [PATCH] fix: Check torch only if needed (#2215) --- package/ios/Core/CameraConfiguration.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package/ios/Core/CameraConfiguration.swift b/package/ios/Core/CameraConfiguration.swift index 020d16e..63cfab1 100644 --- a/package/ios/Core/CameraConfiguration.swift +++ b/package/ios/Core/CameraConfiguration.swift @@ -115,7 +115,8 @@ class CameraConfiguration { // side-props (depends on format) sidePropsChanged = formatChanged || left?.fps != right.fps || left?.enableLowLightBoost != right.enableLowLightBoost // torch (depends on isActive) - torchChanged = left?.isActive != right.isActive || left?.torch != right.torch + let wasInactiveAndNeedsToEnableTorchAgain = left?.isActive == false && right.isActive == true && right.torch == .on + torchChanged = inputChanged || wasInactiveAndNeedsToEnableTorchAgain || left?.torch != right.torch // zoom (depends on format) zoomChanged = formatChanged || left?.zoom != right.zoom // exposure (depends on device)