[#5698] null is not an object .sendToBridge
Signed-off-by: Andrey Shovkoplyas <motor4ik@gmail.com>
This commit is contained in:
parent
acb8c7905d
commit
9175f2e124
|
@ -20,10 +20,7 @@ window.addEventListener('message', function (event) {
|
||||||
WebViewBridge.onMessage = function (message) {
|
WebViewBridge.onMessage = function (message) {
|
||||||
data = JSON.parse(message);
|
data = JSON.parse(message);
|
||||||
|
|
||||||
if (data.type === "navigate-to-blank")
|
if (data.type === "status-api-success")
|
||||||
window.location.href = "about:blank";
|
|
||||||
|
|
||||||
else if (data.type === "status-api-success")
|
|
||||||
{
|
{
|
||||||
window.dispatchEvent(new CustomEvent('statusapi', { detail: { permissions: data.keys,
|
window.dispatchEvent(new CustomEvent('statusapi', { detail: { permissions: data.keys,
|
||||||
data: data.data
|
data: data.data
|
||||||
|
|
|
@ -21,10 +21,7 @@ window.addEventListener('message', function (event) {
|
||||||
WebViewBridge.onMessage = function (message) {
|
WebViewBridge.onMessage = function (message) {
|
||||||
data = JSON.parse(message);
|
data = JSON.parse(message);
|
||||||
|
|
||||||
if (data.type === "navigate-to-blank")
|
if (data.type === "status-api-success")
|
||||||
window.location.href = "about:blank";
|
|
||||||
|
|
||||||
else if (data.type === "status-api-success")
|
|
||||||
{
|
{
|
||||||
if (data.keys == 'WEB3')
|
if (data.keys == 'WEB3')
|
||||||
{
|
{
|
||||||
|
|
|
@ -322,7 +322,8 @@
|
||||||
(re-frame/reg-fx
|
(re-frame/reg-fx
|
||||||
:browser/send-to-bridge
|
:browser/send-to-bridge
|
||||||
(fn [{:keys [message webview]}]
|
(fn [{:keys [message webview]}]
|
||||||
(.sendToBridge webview (types/clj->json message))))
|
(when (and message webview)
|
||||||
|
(.sendToBridge webview (types/clj->json message)))))
|
||||||
|
|
||||||
(re-frame/reg-fx
|
(re-frame/reg-fx
|
||||||
:browser/call-rpc
|
:browser/call-rpc
|
||||||
|
|
|
@ -48,12 +48,10 @@
|
||||||
[react/touchable-highlight {:style {:flex 1} :on-press #(re-frame/dispatch [:browser.ui/url-input-pressed])}
|
[react/touchable-highlight {:style {:flex 1} :on-press #(re-frame/dispatch [:browser.ui/url-input-pressed])}
|
||||||
[react/text {:style styles/url-text} (http/url-host url)]])]]))
|
[react/text {:style styles/url-text} (http/url-host url)]])]]))
|
||||||
|
|
||||||
(defn toolbar [webview error? url browser browser-id url-editing?]
|
(defn toolbar [error? url browser browser-id url-editing?]
|
||||||
[toolbar.view/toolbar {}
|
[toolbar.view/toolbar {}
|
||||||
[toolbar.view/nav-button-with-count
|
[toolbar.view/nav-button-with-count
|
||||||
(actions/close (fn []
|
(actions/close (fn []
|
||||||
(when @webview
|
|
||||||
(.sendToBridge @webview "navigate-to-blank"))
|
|
||||||
(re-frame/dispatch [:navigate-back])
|
(re-frame/dispatch [:navigate-back])
|
||||||
(when error?
|
(when error?
|
||||||
(re-frame/dispatch [:browser.ui/remove-browser-pressed browser-id]))))]
|
(re-frame/dispatch [:browser.ui/remove-browser-pressed browser-id]))))]
|
||||||
|
@ -108,7 +106,7 @@
|
||||||
(not (nil? (:url props)))))}
|
(not (nil? (:url props)))))}
|
||||||
[react/view styles/browser
|
[react/view styles/browser
|
||||||
[status-bar/status-bar]
|
[status-bar/status-bar]
|
||||||
[toolbar webview error? url browser browser-id url-editing?]
|
[toolbar error? url browser browser-id url-editing?]
|
||||||
[react/view components.styles/flex
|
[react/view components.styles/flex
|
||||||
(if unsafe?
|
(if unsafe?
|
||||||
[site-blocked.views/view {:can-go-back? can-go-back?
|
[site-blocked.views/view {:can-go-back? can-go-back?
|
||||||
|
|
Loading…
Reference in New Issue