Admin: fix notification counters for approvals

This commit is contained in:
Alex Gleason 2020-12-29 20:52:11 -06:00
parent e7bb78712a
commit 8dcd64f168
No known key found for this signature in database
GPG key ID: 7211D1F99744FBB7
2 changed files with 3 additions and 2 deletions

View file

@ -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 => ({

View file

@ -37,7 +37,7 @@ class AdminNav extends React.PureComponent {
<IconWithCounter icon='gavel' count={reportsCount} fixedWidth />
<FormattedMessage id='admin_nav.reports' defaultMessage='Reports' />
</a>
{instance.get('approval_required') && (
{instance.get('approval_required') || approvalCount > 0 && (
<NavLink className='promo-panel-item' to='/admin/approval'>
<IconWithCounter icon='user' count={approvalCount} fixedWidth />
<FormattedMessage id='admin_nav.awaiting_approval' defaultMessage='Awaiting Approval' />