[fix #2314] do not try to update wallet and transactions when offline
This commit is contained in:
parent
dc61971608
commit
156089b07b
|
@ -86,7 +86,8 @@
|
||||||
|
|
||||||
(handlers/register-handler-fx
|
(handlers/register-handler-fx
|
||||||
:update-wallet
|
:update-wallet
|
||||||
(fn [{{:keys [web3 accounts/current-account-id network] :as db} :db} [_ symbols]]
|
(fn [{{:keys [web3 accounts/current-account-id network network-status] :as db} :db} [_ symbols]]
|
||||||
|
(when-not (= network-status :offline)
|
||||||
{:get-balance {:web3 web3
|
{:get-balance {:web3 web3
|
||||||
:account-id current-account-id
|
:account-id current-account-id
|
||||||
:success-event :update-balance-success
|
:success-event :update-balance-success
|
||||||
|
@ -105,18 +106,19 @@
|
||||||
(clear-error-message :prices-update)
|
(clear-error-message :prices-update)
|
||||||
(clear-error-message :balance-update)
|
(clear-error-message :balance-update)
|
||||||
(assoc-in [:wallet :balance-loading?] true)
|
(assoc-in [:wallet :balance-loading?] true)
|
||||||
(assoc :prices-loading? true))}))
|
(assoc :prices-loading? true))})))
|
||||||
|
|
||||||
(handlers/register-handler-fx
|
(handlers/register-handler-fx
|
||||||
:update-transactions
|
:update-transactions
|
||||||
(fn [{{:keys [accounts/current-account-id network] :as db} :db} _]
|
(fn [{{:keys [accounts/current-account-id network network-status] :as db} :db} _]
|
||||||
|
(when-not (= network-status :offline)
|
||||||
{:get-transactions {:account-id current-account-id
|
{:get-transactions {:account-id current-account-id
|
||||||
:network network
|
:network network
|
||||||
:success-event :update-transactions-success
|
:success-event :update-transactions-success
|
||||||
:error-event :update-transactions-fail}
|
:error-event :update-transactions-fail}
|
||||||
:db (-> db
|
:db (-> db
|
||||||
(clear-error-message :transaction-update)
|
(clear-error-message :transaction-update)
|
||||||
(assoc-in [:wallet :transactions-loading?] true))}))
|
(assoc-in [:wallet :transactions-loading?] true))})))
|
||||||
|
|
||||||
(handlers/register-handler-db
|
(handlers/register-handler-db
|
||||||
:update-transactions-success
|
:update-transactions-success
|
||||||
|
|
Loading…
Reference in New Issue