do not download newest content on channel subscription; do still set latest

This commit is contained in:
Travis Eden 2018-08-13 12:14:53 -04:00
parent 386e9271ff
commit 02c20d090e

View file

@ -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 <SubscriptionsPage>
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) => (