do not download newest content on channel subscription; do still set latest
This commit is contained in:
parent
386e9271ff
commit
02c20d090e
1 changed files with 8 additions and 6 deletions
|
@ -124,10 +124,11 @@ export const setSubscriptionNotification = (
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const doCheckSubscription = (subscription: Subscription, notify?: boolean) => (
|
export const doCheckSubscription = (
|
||||||
dispatch: Dispatch,
|
subscription: Subscription,
|
||||||
getState: () => {}
|
notify?: boolean,
|
||||||
) => {
|
preventDownload?: boolean
|
||||||
|
) => (dispatch: Dispatch, getState: () => {}) => {
|
||||||
// no dispatching FETCH_CHANNEL_CLAIMS_STARTED; causes loading issues on <SubscriptionsPage>
|
// no dispatching FETCH_CHANNEL_CLAIMS_STARTED; causes loading issues on <SubscriptionsPage>
|
||||||
|
|
||||||
Lbry.claim_list_by_channel({ uri: subscription.uri, page: 1 }).then(result => {
|
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 state = getState();
|
||||||
const downloadCount = selectDownloadingCount(state);
|
const downloadCount = selectDownloadingCount(state);
|
||||||
const shouldDownload = Boolean(
|
const shouldDownload = Boolean(
|
||||||
downloadCount < SUBSCRIPTION_DOWNLOAD_LIMIT &&
|
!preventDownload &&
|
||||||
|
downloadCount < SUBSCRIPTION_DOWNLOAD_LIMIT &&
|
||||||
!claim.value.stream.metadata.fee &&
|
!claim.value.stream.metadata.fee &&
|
||||||
makeSelectClientSetting(SETTINGS.AUTO_DOWNLOAD)(state)
|
makeSelectClientSetting(SETTINGS.AUTO_DOWNLOAD)(state)
|
||||||
);
|
);
|
||||||
|
@ -231,7 +233,7 @@ export const doChannelSubscribe = (subscription: Subscription) => (
|
||||||
dispatch(doClaimRewardType(rewards.SUBSCRIPTION, { failSilently: true }));
|
dispatch(doClaimRewardType(rewards.SUBSCRIPTION, { failSilently: true }));
|
||||||
}
|
}
|
||||||
|
|
||||||
dispatch(doCheckSubscription(subscription, true));
|
dispatch(doCheckSubscription(subscription, false, true));
|
||||||
};
|
};
|
||||||
|
|
||||||
export const doChannelUnsubscribe = (subscription: Subscription) => (
|
export const doChannelUnsubscribe = (subscription: Subscription) => (
|
||||||
|
|
Loading…
Add table
Reference in a new issue