From 8dcd64f1681df0e793747796ddfa4ff76dcb7f58 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Tue, 29 Dec 2020 20:52:11 -0600 Subject: [PATCH] Admin: fix notification counters for approvals --- app/soapbox/components/helmet.js | 3 ++- app/soapbox/features/admin/components/admin_nav.js | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/soapbox/components/helmet.js b/app/soapbox/components/helmet.js index 0fb0e3cb5..080f234c1 100644 --- a/app/soapbox/components/helmet.js +++ b/app/soapbox/components/helmet.js @@ -7,7 +7,8 @@ const getNotifTotals = state => { const notifications = state.getIn(['notifications', 'unread'], 0); const chats = state.get('chats').reduce((acc, curr) => acc + Math.min(curr.get('unread', 0), 1), 0); const reports = state.getIn(['admin', 'open_report_count'], 0); - return notifications + chats + reports; + const approvals = state.getIn(['admin', 'awaitingApproval']).count(); + return notifications + chats + reports + approvals; }; const mapStateToProps = state => ({ diff --git a/app/soapbox/features/admin/components/admin_nav.js b/app/soapbox/features/admin/components/admin_nav.js index 06aa236f5..a89c9ada0 100644 --- a/app/soapbox/features/admin/components/admin_nav.js +++ b/app/soapbox/features/admin/components/admin_nav.js @@ -37,7 +37,7 @@ class AdminNav extends React.PureComponent { - {instance.get('approval_required') && ( + {instance.get('approval_required') || approvalCount > 0 && (