From 1b92cb4d1e64b7643cc41cd23cdac1d197799371 Mon Sep 17 00:00:00 2001 From: Thomas Zarebczan Date: Fri, 30 Nov 2018 13:59:36 -0500 Subject: [PATCH] fetch subs fix Instead of calling check subscriptions after fetching them (with a timeout hack), do this directly in the fetch routine instead of calling claim_list_by_channel. This ensures claim_list_by_channel is only called once and the subscriptions are checked after every fetch. --- src/renderer/redux/actions/subscriptions.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/renderer/redux/actions/subscriptions.js b/src/renderer/redux/actions/subscriptions.js index eb263a400..4bc9627c0 100644 --- a/src/renderer/redux/actions/subscriptions.js +++ b/src/renderer/redux/actions/subscriptions.js @@ -102,7 +102,7 @@ export const doFetchMySubscriptions = () => (dispatch: ReduxDispatch, getState: }); dispatch(doResolveUris(subscriptions.map(({ uri }) => uri))); - subscriptions.forEach(({ uri }) => dispatch(doFetchClaimsByChannel(uri, 1))); + dispatch(doCheckSubscriptions()); }) .catch(() => { dispatch({ @@ -401,7 +401,6 @@ export const doCheckSubscriptionsInit = () => (dispatch: ReduxDispatch) => { // setTimeout below is a hack to ensure redux is hydrated when subscriptions are checked // this will be replaced with which reqiures a package upgrade setTimeout(() => dispatch(doFetchMySubscriptions()), 5000); - setTimeout(() => dispatch(doCheckSubscriptions()), 10000); const checkSubscriptionsTimer = setInterval( () => dispatch(doCheckSubscriptions()), CHECK_SUBSCRIPTIONS_INTERVAL