[#9280] Make sure number-of-retries is not negative

This commit is contained in:
Roman Volosovskyi 2020-01-28 16:24:24 +02:00
parent 028543aa31
commit 9dfb908678
No known key found for this signature in database
GPG Key ID: 0238A4B5ECEE70DE
1 changed files with 6 additions and 6 deletions

View File

@ -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