Skip to content

Commit 932abf1

Browse files
committed
fix: prevent alert view dismiss from triggering onBrowserClosed event
1 parent a25254a commit 932abf1

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Sources/OSInAppBrowserLib/RouterAdapters/OSIABWebViewRouterAdapter.swift

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,10 +121,14 @@ private class OSIABWebViewController: UIHostingController<OSIABWebViewWrapperVie
121121
}
122122

123123
override func dismiss(animated flag: Bool, completion: (() -> Void)? = nil) {
124-
super.dismiss(animated: flag, completion: {
124+
guard presentedViewController == nil else {
125+
return super.dismiss(animated: flag, completion: completion)
126+
}
127+
128+
super.dismiss(animated: flag) {
125129
self.dismiss?()
126130
completion?()
127-
})
131+
}
128132
}
129133
}
130134

0 commit comments

Comments
 (0)