From 74a01a7b3e315f4996fe917e3a3ac4934958ac61 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Sun, 7 Jun 2020 15:11:41 -0500 Subject: [PATCH] MoreFollows: count can never be negative, fixes #146 --- app/soapbox/utils/accounts.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/soapbox/utils/accounts.js b/app/soapbox/utils/accounts.js index 4b9a4c369..3d04a3360 100644 --- a/app/soapbox/utils/accounts.js +++ b/app/soapbox/utils/accounts.js @@ -33,5 +33,5 @@ export const isModerator = account => ( export const getFollowDifference = (state, accountId, type) => { const listSize = state.getIn(['user_lists', type, accountId, 'items'], ImmutableList()).size; const counter = state.getIn(['accounts_counters', accountId, `${type}_count`], 0); - return counter - listSize; + return Math.max(counter - listSize, 0); };