[#9280] Make sure number-of-retries is not negative
This commit is contained in:
parent
028543aa31
commit
9dfb908678
|
@ -39,10 +39,10 @@
|
||||||
:params [address "latest"]
|
:params [address "latest"]
|
||||||
:on-success on-success
|
:on-success on-success
|
||||||
:on-error (fn [error]
|
:on-error (fn [error]
|
||||||
(if (zero? number-of-retries)
|
(if (pos? number-of-retries)
|
||||||
(on-error error)
|
|
||||||
(get-balance
|
(get-balance
|
||||||
(update params :number-of-retries dec))))}))
|
(update params :number-of-retries dec))
|
||||||
|
(on-error error)))}))
|
||||||
|
|
||||||
(re-frame/reg-fx
|
(re-frame/reg-fx
|
||||||
:wallet/get-balances
|
:wallet/get-balances
|
||||||
|
@ -202,9 +202,9 @@
|
||||||
[::update-tokens-balances-success balances]))))
|
[::update-tokens-balances-success balances]))))
|
||||||
:on-error
|
:on-error
|
||||||
(fn [error]
|
(fn [error]
|
||||||
(if (zero? number-of-retries)
|
(if (pos? number-of-retries)
|
||||||
(re-frame/dispatch [::update-token-balance-fail error])
|
(get-token-balances (update params :number-of-retries dec))
|
||||||
(get-token-balances (update params :number-of-retries dec))))}))
|
(re-frame/dispatch [::update-token-balance-fail error])))}))
|
||||||
|
|
||||||
(re-frame/reg-fx
|
(re-frame/reg-fx
|
||||||
:wallet/get-tokens-balances
|
:wallet/get-tokens-balances
|
||||||
|
|
Loading…
Reference in New Issue