count should never be less than 0

This commit is contained in:
riley
2017-05-03 12:49:22 -06:00
parent 39bd0eca6f
commit 3c6391e741
@@ -79,10 +79,10 @@ export const setCommentStatus = graphql(SET_COMMENT_STATUS, {
return {
...oldData,
premodCount,
flaggedCount,
acceptedCount,
rejectedCount,
premodCount: Math.max(0, premodCount),
flaggedCount: Math.max(0, flaggedCount),
acceptedCount: Math.max(0, acceptedCount),
rejectedCount: Math.max(0, rejectedCount),
premod,
flagged,
accepted,
@@ -124,10 +124,10 @@ export const setCommentStatus = graphql(SET_COMMENT_STATUS, {
return {
...oldData,
premodCount,
flaggedCount,
acceptedCount,
rejectedCount,
premodCount: Math.max(0, premodCount),
flaggedCount: Math.max(0, flaggedCount),
acceptedCount: Math.max(0, acceptedCount),
rejectedCount: Math.max(0, rejectedCount),
premod,
flagged,
accepted,