Skip to content

Commit

Permalink
fix webview presenting
Browse files Browse the repository at this point in the history
  • Loading branch information
RyosukeCla committed Oct 23, 2023
1 parent 6667a44 commit 69f2796
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
13 changes: 12 additions & 1 deletion ios/Nativebrik/Classes/component.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,18 @@ class ModalComponentViewController: UIViewController {
return
}
let safariVC = SFSafariViewController(url: urlObj)
self.presentToTop(safariVC)
if let modal = self.currentModal {
if !isPresenting(presented: self.presentedViewController, vc: modal) {
self.currentModal?.dismiss(animated: false)
self.currentModal = nil
}
}

if let modal = self.currentModal {
modal.present(safariVC, animated: true)
} else {
self.presentToTop(safariVC)
}
}

func presentNavigation(
Expand Down
5 changes: 5 additions & 0 deletions ios/Nativebrik/Classes/root.swift
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,11 @@ class ModalRootViewController: UIViewController {
self.modalViewController?.dismissModal()
return
}

if page?.data?.kind == PageKind.WEBVIEW_MODAL {
self.modalViewController?.presentWebview(url: page?.data?.webviewUrl ?? "https://nativebrik.com/intl/en/docs/reference/ios")
return
}

let pageView = PageView(
page: page,
Expand Down

0 comments on commit 69f2796

Please sign in to comment.