From 02c20d090ebeb6b59b18a945c73f16d1b7745fe8 Mon Sep 17 00:00:00 2001 From: Travis Eden Date: Mon, 13 Aug 2018 12:14:53 -0400 Subject: [PATCH] do not download newest content on channel subscription; do still set latest --- src/renderer/redux/actions/subscriptions.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/renderer/redux/actions/subscriptions.js b/src/renderer/redux/actions/subscriptions.js index 02fd76df6..3d7edb87f 100644 --- a/src/renderer/redux/actions/subscriptions.js +++ b/src/renderer/redux/actions/subscriptions.js @@ -124,10 +124,11 @@ export const setSubscriptionNotification = ( }, }); -export const doCheckSubscription = (subscription: Subscription, notify?: boolean) => ( - dispatch: Dispatch, - getState: () => {} -) => { +export const doCheckSubscription = ( + subscription: Subscription, + notify?: boolean, + preventDownload?: boolean +) => (dispatch: Dispatch, getState: () => {}) => { // no dispatching FETCH_CHANNEL_CLAIMS_STARTED; causes loading issues on Lbry.claim_list_by_channel({ uri: subscription.uri, page: 1 }).then(result => { @@ -144,7 +145,8 @@ export const doCheckSubscription = (subscription: Subscription, notify?: boolean const state = getState(); const downloadCount = selectDownloadingCount(state); const shouldDownload = Boolean( - downloadCount < SUBSCRIPTION_DOWNLOAD_LIMIT && + !preventDownload && + downloadCount < SUBSCRIPTION_DOWNLOAD_LIMIT && !claim.value.stream.metadata.fee && makeSelectClientSetting(SETTINGS.AUTO_DOWNLOAD)(state) ); @@ -231,7 +233,7 @@ export const doChannelSubscribe = (subscription: Subscription) => ( dispatch(doClaimRewardType(rewards.SUBSCRIPTION, { failSilently: true })); } - dispatch(doCheckSubscription(subscription, true)); + dispatch(doCheckSubscription(subscription, false, true)); }; export const doChannelUnsubscribe = (subscription: Subscription) => (