Merge pull request #251 from lbryio/fix-zeroClaimsBug

fix bug of reporting 0 total claims
This commit is contained in:
Sean Yesmunt 2019-12-13 16:25:19 -05:00 committed by GitHub
commit e78c2a7e9f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

2
dist/bundle.es.js vendored
View file

@ -2161,7 +2161,7 @@ const makeSelectNsfwCountForChannel = uri => reselect.createSelector(selectClaim
}); });
const makeSelectOmittedCountForChannel = uri => reselect.createSelector(makeSelectTotalItemsForChannel(uri), makeSelectTotalClaimsInChannelSearch(uri), (claimsInChannel, claimsInSearch) => { const makeSelectOmittedCountForChannel = uri => reselect.createSelector(makeSelectTotalItemsForChannel(uri), makeSelectTotalClaimsInChannelSearch(uri), (claimsInChannel, claimsInSearch) => {
if (claimsInChannel && claimsInSearch) { if (claimsInChannel && typeof claimsInSearch === 'number' && claimsInSearch >= 0) {
return claimsInChannel - claimsInSearch; return claimsInChannel - claimsInSearch;
} else return 0; } else return 0;
}); });

View file

@ -471,7 +471,7 @@ export const makeSelectOmittedCountForChannel = (uri: string) =>
makeSelectTotalItemsForChannel(uri), makeSelectTotalItemsForChannel(uri),
makeSelectTotalClaimsInChannelSearch(uri), makeSelectTotalClaimsInChannelSearch(uri),
(claimsInChannel, claimsInSearch) => { (claimsInChannel, claimsInSearch) => {
if (claimsInChannel && claimsInSearch) { if (claimsInChannel && typeof claimsInSearch === 'number' && claimsInSearch >= 0) {
return claimsInChannel - claimsInSearch; return claimsInChannel - claimsInSearch;
} }
else return 0; else return 0;