bug #4930 - atomic navigation after error prevents send screen being briefly shown with invalid data

Signed-off-by: Goran Jovic <goranjovic@gmail.com>
This commit is contained in:
Goran Jovic 2018-07-05 13:38:33 +02:00
parent d63ffc0a23
commit 75a1430075
No known key found for this signature in database
GPG Key ID: D429D1A9B2EB8A8E
2 changed files with 3 additions and 3 deletions

View File

@ -92,7 +92,7 @@
[react/text {:style styles/text-secondary-content} [react/text {:style styles/text-secondary-content}
(clojure.core/name symbol)]] (clojure.core/name symbol)]]
[react/text {:style (merge styles/text-secondary-content styles/asset-label)} [react/text {:style (merge styles/text-secondary-content styles/asset-label)}
(str (wallet.utils/format-amount (symbol balance) decimals))]]]] (str (wallet.utils/format-amount (get balance symbol) decimals))]]]]
(when error (when error
[tooltip/tooltip error {}])]))) [tooltip/tooltip error {}])])))

View File

@ -257,10 +257,10 @@
;;NO ERROR, DISCARDED, TIMEOUT or DEFAULT ERROR ;;NO ERROR, DISCARDED, TIMEOUT or DEFAULT ERROR
(if (this-transaction-signing? id (:id send-transaction) view-id modal) (if (this-transaction-signing? id (:id send-transaction) view-id modal)
(cond-> {:db (-> db (cond-> {:db (-> db
navigation/navigate-back
(assoc-in [:wallet :transactions-queue] nil) (assoc-in [:wallet :transactions-queue] nil)
(update-in [:wallet :transactions-unsigned] dissoc id) (update-in [:wallet :transactions-unsigned] dissoc id)
(update-in [:wallet :send-transaction] merge clear-send-properties)) (update-in [:wallet :send-transaction] merge clear-send-properties))}
:dispatch [:navigate-back]}
(= method constants/web3-send-transaction) (= method constants/web3-send-transaction)
(handle-failed-tx error_message)) (handle-failed-tx error_message))
{:db (update-in db [:wallet :transactions-unsigned] dissoc id)}))))) {:db (update-in db [:wallet :transactions-unsigned] dissoc id)})))))