From 00d8a9e5c25bb08000c7fc7625f7f5730b64a5d4 Mon Sep 17 00:00:00 2001 From: jessop Date: Thu, 12 Dec 2019 20:31:37 -0500 Subject: [PATCH] fixes bug of reporting 0 claims --- dist/bundle.es.js | 2 +- src/redux/selectors/claims.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dist/bundle.es.js b/dist/bundle.es.js index 6c3b9df..ff828fe 100644 --- a/dist/bundle.es.js +++ b/dist/bundle.es.js @@ -2042,7 +2042,7 @@ const makeSelectNsfwCountForChannel = uri => reselect.createSelector(selectClaim }); const makeSelectOmittedCountForChannel = uri => reselect.createSelector(makeSelectTotalItemsForChannel(uri), makeSelectTotalClaimsInChannelSearch(uri), (claimsInChannel, claimsInSearch) => { - if (claimsInChannel && claimsInSearch) { + if (claimsInChannel && typeof claimsInSearch === 'number' && claimsInSearch >= 0) { return claimsInChannel - claimsInSearch; } else return 0; }); diff --git a/src/redux/selectors/claims.js b/src/redux/selectors/claims.js index b6cb93c..dafdd43 100644 --- a/src/redux/selectors/claims.js +++ b/src/redux/selectors/claims.js @@ -471,7 +471,7 @@ export const makeSelectOmittedCountForChannel = (uri: string) => makeSelectTotalItemsForChannel(uri), makeSelectTotalClaimsInChannelSearch(uri), (claimsInChannel, claimsInSearch) => { - if (claimsInChannel && claimsInSearch) { + if (claimsInChannel && typeof claimsInSearch === 'number' && claimsInSearch >= 0) { return claimsInChannel - claimsInSearch; } else return 0;