From 9dfb90867807ba53a62d71fc27780d9e2b134935 Mon Sep 17 00:00:00 2001 From: Roman Volosovskyi Date: Tue, 28 Jan 2020 16:24:24 +0200 Subject: [PATCH] [#9280] Make sure number-of-retries is not negative --- src/status_im/wallet/core.cljs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/status_im/wallet/core.cljs b/src/status_im/wallet/core.cljs index c03839e470c..695b75c1ec0 100644 --- a/src/status_im/wallet/core.cljs +++ b/src/status_im/wallet/core.cljs @@ -39,10 +39,10 @@ :params [address "latest"] :on-success on-success :on-error (fn [error] - (if (zero? number-of-retries) - (on-error error) + (if (pos? number-of-retries) (get-balance - (update params :number-of-retries dec))))})) + (update params :number-of-retries dec)) + (on-error error)))})) (re-frame/reg-fx :wallet/get-balances @@ -202,9 +202,9 @@ [::update-tokens-balances-success balances])))) :on-error (fn [error] - (if (zero? number-of-retries) - (re-frame/dispatch [::update-token-balance-fail error]) - (get-token-balances (update params :number-of-retries dec))))})) + (if (pos? number-of-retries) + (get-token-balances (update params :number-of-retries dec)) + (re-frame/dispatch [::update-token-balance-fail error])))})) (re-frame/reg-fx :wallet/get-tokens-balances