Error alert after navigating to external links from app #20177 (#20193)

This commit is contained in:
mmilad75 2024-05-30 12:48:28 +02:00 committed by GitHub
parent 5559599381
commit 19be1382db
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 13 additions and 3 deletions

View File

@ -2,6 +2,7 @@
(:require
["eth-phishing-detect" :as eth-phishing-detect]
[clojure.string :as string]
legacy.status-im.browser.effects
[legacy.status-im.browser.permissions :as browser.permissions]
[legacy.status-im.browser.webview-ref :as webview-ref]
[legacy.status-im.ethereum.ens :as ens]
@ -11,7 +12,6 @@
[legacy.status-im.utils.random :as random]
[native-module.core :as native-module]
[re-frame.core :as re-frame]
[react-native.core :as react]
[react-native.platform :as platform]
[status-im.common.json-rpc.events :as json-rpc]
[status-im.common.universal-links :as links]
@ -315,8 +315,7 @@
(navigation/change-tab :browser-stack)
(update-browser browser)
(resolve-url nil))
(do (.openURL ^js react/linking (url/normalize-url url))
nil)))))
{:linking/open-url url}))))
(rf/defn open-existing-browser
"Opens an existing browser with it's history"

View File

@ -0,0 +1,11 @@
(ns legacy.status-im.browser.effects
(:require [clojure.string :as string]
[react-native.core :as react]
[utils.re-frame :as rf]
[utils.url :as url]))
(rf/reg-fx
:linking/open-url
(fn [url]
(when (not (string/blank? url))
(.openURL ^js react/linking (url/normalize-url url)))))