Merge pull request #1652 from lbryio/subscriptions-fix
fix: fetch subscriptions if there are no claims loaded
This commit is contained in:
commit
249a0c2844
1 changed files with 13 additions and 1 deletions
|
@ -6,6 +6,7 @@ import * as NOTIFICATION_TYPES from 'constants/notification_types';
|
|||
import Button from 'component/button';
|
||||
import FileList from 'component/fileList';
|
||||
import type { Claim } from 'types/claim';
|
||||
import isDev from 'electron-is-dev';
|
||||
|
||||
type Props = {
|
||||
doFetchClaimsByChannel: (string, number) => void,
|
||||
|
@ -42,7 +43,18 @@ export default class extends React.PureComponent<Props> {
|
|||
|
||||
const subscriptionClaimMap = {};
|
||||
subscriptionClaims.forEach(claim => {
|
||||
subscriptionClaimMap[claim.uri] = 1;
|
||||
/*
|
||||
This check added 6/20/18 to fix function receiving empty claims unexpectedly.
|
||||
The better fix is ensuring channels aren't added to byId if there are no associated claims
|
||||
We are adding this now with the redesign release to ensure users see the correct subscriptions
|
||||
*/
|
||||
if (claim.claims.length) {
|
||||
subscriptionClaimMap[claim.uri] = 1;
|
||||
} else if (isDev) {
|
||||
console.error(
|
||||
`claim for ${claim.uri} was added to byId in redux but there are no loaded fetched claims`
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
subscriptions.forEach(sub => {
|
||||
|
|
Loading…
Reference in a new issue