check subscription by uri
This commit is contained in:
parent
5e270c129c
commit
3ba8b7e08f
1 changed files with 5 additions and 4 deletions
|
@ -131,7 +131,9 @@ export const doCheckSubscription = (subscriptionUri: string, notify?: boolean) =
|
||||||
// no dispatching FETCH_CHANNEL_CLAIMS_STARTED; causes loading issues on <SubscriptionsPage>
|
// no dispatching FETCH_CHANNEL_CLAIMS_STARTED; causes loading issues on <SubscriptionsPage>
|
||||||
|
|
||||||
const state = getState();
|
const state = getState();
|
||||||
const savedSubscription = state.subscriptions.subscriptions.find(sub => sub.uri === subscriptionUri);
|
const savedSubscription = state.subscriptions.subscriptions.find(
|
||||||
|
sub => sub.uri === subscriptionUri
|
||||||
|
);
|
||||||
|
|
||||||
Lbry.claim_list_by_channel({ uri: subscriptionUri, page: 1 }).then(result => {
|
Lbry.claim_list_by_channel({ uri: subscriptionUri, page: 1 }).then(result => {
|
||||||
const claimResult = result[subscriptionUri] || {};
|
const claimResult = result[subscriptionUri] || {};
|
||||||
|
@ -168,7 +170,6 @@ export const doCheckSubscription = (subscriptionUri: string, notify?: boolean) =
|
||||||
dispatch(doPurchaseUri(uri, { cost: 0 }));
|
dispatch(doPurchaseUri(uri, { cost: 0 }));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// always setLatest; important for newly subscribed channels
|
// always setLatest; important for newly subscribed channels
|
||||||
|
@ -270,7 +271,7 @@ export const doCheckSubscriptions = () => (dispatch: Dispatch, getState: () => a
|
||||||
const state = getState();
|
const state = getState();
|
||||||
const subscriptions = selectSubscriptions(state);
|
const subscriptions = selectSubscriptions(state);
|
||||||
subscriptions.forEach((sub: Subscription) => {
|
subscriptions.forEach((sub: Subscription) => {
|
||||||
dispatch(doCheckSubscription(sub, true));
|
dispatch(doCheckSubscription(sub.uri, true));
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue