Skip to content

Commit

Permalink
fix: set max option not work when send from qrcode (#13733)
Browse files Browse the repository at this point in the history
  • Loading branch information
yqrashawn authored and ibrkhalil committed Aug 3, 2022
1 parent 85515d9 commit 0f68ffc
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions src/status_im/wallet/choose_recipient/core.cljs
Original file line number Diff line number Diff line change
@@ -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]))

Expand Down Expand Up @@ -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)
Expand All @@ -85,8 +85,15 @@
{:db (update db :wallet/prepare-transaction assoc
:to address :to-name (find-address-name db address))}
(let [current-chain-id (get-in networks [current-network :config :NetworkId])]
(merge {:db (fill-prepare-transaction-details db details all-tokens)
(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})})))))
Expand Down

0 comments on commit 0f68ffc

Please sign in to comment.