From 7ee19656861aa4a931e0d3e94a1fec235389827f Mon Sep 17 00:00:00 2001 From: RyosukeCla Date: Mon, 23 Oct 2023 16:27:39 +0900 Subject: [PATCH] remove default value of the webview url --- ios/Nativebrik/Classes/component.swift | 5 ++++- ios/Nativebrik/Classes/root.swift | 5 +++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/ios/Nativebrik/Classes/component.swift b/ios/Nativebrik/Classes/component.swift index 8d92dbe..c38751f 100644 --- a/ios/Nativebrik/Classes/component.swift +++ b/ios/Nativebrik/Classes/component.swift @@ -14,7 +14,10 @@ import SafariServices class ModalComponentViewController: UIViewController { private var currentModal: NavigationViewControlller? = nil - func presentWebview(url: String) { + func presentWebview(url: String?) { + guard let url = url else { + return + } guard let urlObj = URL(string: url) else { return } diff --git a/ios/Nativebrik/Classes/root.swift b/ios/Nativebrik/Classes/root.swift index 6c45f42..5de2c07 100644 --- a/ios/Nativebrik/Classes/root.swift +++ b/ios/Nativebrik/Classes/root.swift @@ -73,8 +73,9 @@ class ModalRootViewController: UIViewController { return } + // when it's webview modal if page?.data?.kind == PageKind.WEBVIEW_MODAL { - self.modalViewController?.presentWebview(url: page?.data?.webviewUrl ?? "https://nativebrik.com/intl/en/docs/reference/ios") + self.modalViewController?.presentWebview(url: page?.data?.webviewUrl) return } @@ -197,7 +198,7 @@ class RootView: UIView { // when it's webview modal if page?.data?.kind == PageKind.WEBVIEW_MODAL { - self.modalViewController?.presentWebview(url: page?.data?.webviewUrl ?? "https://nativebrik.com/intl/en/docs/reference/ios") + self.modalViewController?.presentWebview(url: page?.data?.webviewUrl) return }