fix: set max option not work when send from qrcode (#13733)

This commit is contained in:
yqrashawn 2022-08-03 22:13:37 +08:00 committed by GitHub
parent c5bcb0123f
commit 71211ee7b9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 14 additions and 7 deletions

View File

@ -1,17 +1,17 @@
(ns status-im.wallet.choose-recipient.core
(:require [re-frame.core :as re-frame]
[status-im.bottom-sheet.core :as bottom-sheet]
[status-im.contact.db :as contact.db]
[status-im.ethereum.core :as ethereum]
[status-im.ethereum.eip681 :as eip681]
[status-im.ethereum.ens :as ens]
[status-im.i18n.i18n :as i18n]
[status-im.utils.money :as money]
[status-im.utils.fx :as fx]
[status-im.router.core :as router]
[status-im.qr-scanner.core :as qr-scaner]
[status-im.bottom-sheet.core :as bottom-sheet]
[status-im.navigation :as navigation]
[status-im.qr-scanner.core :as qr-scaner]
[status-im.router.core :as router]
[status-im.utils.fx :as fx]
[status-im.utils.http :as http]
[status-im.utils.money :as money]
[status-im.utils.universal-links.utils :as links]
[status-im.utils.wallet-connect :as wallet-connect]))
@ -75,7 +75,7 @@
:wallet/keys [all-tokens] :as db} :db}
{:keys [chain-id] :as data}
uri]
(let [{:keys [address] :as details}
(let [{:keys [address gasPrice] :as details}
(eip681/extract-request-details data all-tokens)]
(if address
(if (:wallet/recipient db)
@ -87,6 +87,13 @@
(let [current-chain-id (get-in networks [current-network :config :NetworkId])]
(merge {:db (fill-prepare-transaction-details db details all-tokens)
:dispatch [:open-modal :prepare-send-transaction]}
(when-not gasPrice
{:signing/update-gas-price
{:success-callback
#(re-frame/dispatch
[:wallet.send/update-gas-price-success :wallet/prepare-transaction %])
:network-id (get-in (ethereum/current-network db)
[:config :NetworkId])}})
(when (and chain-id (not= current-chain-id chain-id))
{:ui/show-error (i18n/label :t/wallet-invalid-chain-id
{:data uri :chain current-chain-id})})))))