From 54205fea233d80cdcf06912a42021693c10d7c6a Mon Sep 17 00:00:00 2001 From: Michael Bischof Date: Fri, 9 Aug 2024 09:45:36 +0200 Subject: [PATCH] fix(ios): `Application tried to present modally a view controller that is already being presented by ...` exception --- ios/Plugin/PrivacyScreen.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ios/Plugin/PrivacyScreen.swift b/ios/Plugin/PrivacyScreen.swift index 0453db2..0e704da 100644 --- a/ios/Plugin/PrivacyScreen.swift +++ b/ios/Plugin/PrivacyScreen.swift @@ -64,7 +64,7 @@ import UIKit let window = UIApplication.shared.connectedScenes .filter({$0.activationState == .foregroundActive || $0.activationState == .foregroundInactive}) .compactMap({$0 as? UIWindowScene}).first?.windows.filter({$0.isKeyWindow}).first - if var rootVC = window?.rootViewController { + if var rootVC = window?.rootViewController, !self.privacyViewController.isBeingPresented { while let topVC = rootVC.presentedViewController { rootVC = topVC }