[fix 6047] fix bridge functions cofx position
Signed-off-by: yenda <eric@status.im>
This commit is contained in:
parent
8638c562f9
commit
9fc2105cb8
|
@ -225,8 +225,8 @@
|
||||||
(update-browser browser)
|
(update-browser browser)
|
||||||
(navigation/navigate-to-cofx :browser nil))))
|
(navigation/navigate-to-cofx :browser nil))))
|
||||||
|
|
||||||
(defn web3-send-async
|
(fx/defn web3-send-async
|
||||||
[{:keys [method] :as payload} message-id {:keys [db]}]
|
[{:keys [db]} {:keys [method] :as payload} message-id]
|
||||||
(if (or (= method constants/web3-send-transaction)
|
(if (or (= method constants/web3-send-transaction)
|
||||||
(= method constants/web3-personal-sign))
|
(= method constants/web3-personal-sign))
|
||||||
{:db (update-in db [:wallet :transactions-queue] conj {:message-id message-id :payload payload})
|
{:db (update-in db [:wallet :transactions-queue] conj {:message-id message-id :payload payload})
|
||||||
|
@ -244,17 +244,17 @@
|
||||||
{:browser/send-to-bridge {:message message
|
{:browser/send-to-bridge {:message message
|
||||||
:webview (get-in cofx [:db :webview-bridge])}})
|
:webview (get-in cofx [:db :webview-bridge])}})
|
||||||
|
|
||||||
(defn web3-send-async-read-only
|
(fx/defn web3-send-async-read-only
|
||||||
[dapp-name {:keys [method] :as payload} message-id {:keys [db] :as cofx}]
|
[{:keys [db] :as cofx} dapp-name {:keys [method] :as payload} message-id]
|
||||||
(let [{:dapps/keys [permissions]} db]
|
(let [{:dapps/keys [permissions]} db]
|
||||||
(if (and (#{"eth_accounts" "eth_coinbase" "eth_sendTransaction" "eth_sign"
|
(if (and (#{"eth_accounts" "eth_coinbase" "eth_sendTransaction" "eth_sign"
|
||||||
"eth_signTypedData" "personal_sign" "personal_ecRecover"} method)
|
"eth_signTypedData" "personal_sign" "personal_ecRecover"} method)
|
||||||
(not (some #{"WEB3"} (get-in permissions [dapp-name :permissions]))))
|
(not (some #{"WEB3"} (get-in permissions [dapp-name :permissions]))))
|
||||||
(send-to-bridge {:type constants/web3-send-async-callback
|
(send-to-bridge cofx
|
||||||
|
{:type constants/web3-send-async-callback
|
||||||
:messageId message-id
|
:messageId message-id
|
||||||
:error "Denied"}
|
:error "Denied"})
|
||||||
cofx)
|
(web3-send-async cofx payload message-id))))
|
||||||
(web3-send-async payload message-id cofx))))
|
|
||||||
|
|
||||||
(fx/defn handle-scanned-qr-code
|
(fx/defn handle-scanned-qr-code
|
||||||
[cofx data message]
|
[cofx data message]
|
||||||
|
@ -275,13 +275,13 @@
|
||||||
(and (= type constants/history-state-changed)
|
(and (= type constants/history-state-changed)
|
||||||
platform/ios?
|
platform/ios?
|
||||||
(not= "about:blank" url))
|
(not= "about:blank" url))
|
||||||
(update-browser-history browser url false cofx)
|
(update-browser-history cofx browser url false)
|
||||||
|
|
||||||
(= type constants/web3-send-async)
|
(= type constants/web3-send-async)
|
||||||
(web3-send-async payload messageId cofx)
|
(web3-send-async cofx payload messageId)
|
||||||
|
|
||||||
(= type constants/web3-send-async-read-only)
|
(= type constants/web3-send-async-read-only)
|
||||||
(web3-send-async-read-only dapp-name payload messageId cofx)
|
(web3-send-async-read-only cofx dapp-name payload messageId)
|
||||||
|
|
||||||
(= type constants/scan-qr-code)
|
(= type constants/scan-qr-code)
|
||||||
(qr-scanner/scan-qr-code cofx
|
(qr-scanner/scan-qr-code cofx
|
||||||
|
|
Loading…
Reference in New Issue