Fix sending collectible by building transaction before signing (#21744)

* Fix sending collectible by building transaction before signing
This commit is contained in:
Volodymyr Kozieiev 2024-12-05 10:19:26 +00:00 committed by GitHub
parent caaff74efe
commit 27bfbea6bd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 18 additions and 0 deletions

View File

@ -336,6 +336,13 @@
:start-flow? start-flow?
:flow-id :wallet-send-flow}]]]})))
(rf/reg-event-fx
:wallet/build-transaction-for-collectible-route
(fn [{:keys [db]}]
(let [last-request-uuid (get-in db [:wallet :ui :send :last-request-uuid])]
{:db (update-in db [:wallet :ui :send] dissoc :transaction-for-signing)
:fx [[:dispatch [:wallet/build-transactions-from-route {:request-uuid last-request-uuid}]]]})))
(rf/reg-event-fx
:wallet/set-token-amount-to-bridge
(fn [{:keys [db]} [{:keys [amount stack-id start-flow?]}]]

View File

@ -249,6 +249,17 @@
user-props {:full-name to-address
:address (utils/get-shortened-address
to-address)}]
;; In token send flow we already have transaction built when
;; we reach confirmation screen. But in send collectible flow
;; routes request happens at the same time with navigation to
;; confirmation screen. So we need to build the transaction as soon
;; as route is available.
(rn/use-effect
(fn []
(when (and (send-utils/tx-type-collectible? transaction-type)
first-route)
(rf/dispatch [:wallet/build-transaction-for-collectible-route])))
[first-route])
[rn/view {:style {:flex 1}}
[floating-button-page/view
{:footer-container-padding 0