From fe80c5e1b118490291c7f72dcc758e72764c6fb7 Mon Sep 17 00:00:00 2001 From: RyosukeCla Date: Tue, 4 Jun 2024 16:53:08 +0900 Subject: [PATCH 1/2] Update currentVC type in trigger.swift --- ios/Nativebrik/Nativebrik/component/trigger.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ios/Nativebrik/Nativebrik/component/trigger.swift b/ios/Nativebrik/Nativebrik/component/trigger.swift index b6231e4..5f17807 100644 --- a/ios/Nativebrik/Nativebrik/component/trigger.swift +++ b/ios/Nativebrik/Nativebrik/component/trigger.swift @@ -17,7 +17,7 @@ class TriggerViewController: UIViewController { private let user: NativebrikUser private let container: Container private var modalViewController: ModalComponentViewController? = nil - private var currentVC: UIViewController? = nil + private var currentVC: ModalRootViewController? = nil private var didLoaded = false private var ignoreFirstUserEventToForegroundEvent = true From 688601d1fbeec22952c657150f75d0cf85637ba5 Mon Sep 17 00:00:00 2001 From: RyosukeCla Date: Tue, 4 Jun 2024 16:53:19 +0900 Subject: [PATCH 2/2] Dismiss modal view controller in ModalRootViewController --- ios/Nativebrik/Nativebrik/component/root.swift | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ios/Nativebrik/Nativebrik/component/root.swift b/ios/Nativebrik/Nativebrik/component/root.swift index bc82bba..9df80fb 100644 --- a/ios/Nativebrik/Nativebrik/component/root.swift +++ b/ios/Nativebrik/Nativebrik/component/root.swift @@ -22,6 +22,7 @@ class ModalRootViewController: UIViewController { return page.data?.kind == PageKind.TRIGGER } self.modalViewController = modalViewController + self.modalViewController?.dismissModal() self.container = container super.init(nibName: nil, bundle: nil) @@ -235,6 +236,9 @@ class RootView: UIView { func findTopPresenting(_ viewContorller: UIViewController) -> UIViewController { if let presented = viewContorller.presentedViewController { + if presented.isBeingDismissed { + return viewContorller + } return findTopPresenting(presented) } else { return viewContorller