diff options
author | Claire <claire.github-309c@sitedethib.com> | 2021-03-19 12:47:31 +0100 |
---|---|---|
committer | Claire <claire.github-309c@sitedethib.com> | 2021-03-19 13:57:32 +0100 |
commit | db6551ec09cd8f38a9448ba6f4caae56f7a9bb3d (patch) | |
tree | 8af26b3487daafa53585ab54bb6d27e12cb9b6b5 /app/javascript/flavours/glitch/features/notifications/index.js | |
parent | 3ad6ef72cb3a02135a0f395a8a46323e86c4b334 (diff) |
Add option to opt out of unread notification markers
Port 55ac2b9c6085def9e692fa69b849239c1249d9fd to glitch-soc
Diffstat (limited to 'app/javascript/flavours/glitch/features/notifications/index.js')
-rw-r--r-- | app/javascript/flavours/glitch/features/notifications/index.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/javascript/flavours/glitch/features/notifications/index.js b/app/javascript/flavours/glitch/features/notifications/index.js index 5ceda9a91..842e02371 100644 --- a/app/javascript/flavours/glitch/features/notifications/index.js +++ b/app/javascript/flavours/glitch/features/notifications/index.js @@ -67,8 +67,8 @@ const mapStateToProps = state => ({ hasMore: state.getIn(['notifications', 'hasMore']), numPending: state.getIn(['notifications', 'pendingItems'], ImmutableList()).size, notifCleaningActive: state.getIn(['notifications', 'cleaningMode']), - lastReadId: state.getIn(['local_settings', 'notifications', 'show_unread']) ? state.getIn(['notifications', 'readMarkerId']) : '0', - canMarkAsRead: state.getIn(['local_settings', 'notifications', 'show_unread']) && state.getIn(['notifications', 'readMarkerId']) !== '0' && getNotifications(state).some(item => item !== null && compareId(item.get('id'), state.getIn(['notifications', 'readMarkerId'])) > 0), + lastReadId: state.getIn(['settings', 'notifications', 'showUnread']) ? state.getIn(['notifications', 'readMarkerId']) : '0', + canMarkAsRead: state.getIn(['settings', 'notifications', 'showUnread']) && state.getIn(['notifications', 'readMarkerId']) !== '0' && getNotifications(state).some(item => item !== null && compareId(item.get('id'), state.getIn(['notifications', 'readMarkerId'])) > 0), needsNotificationPermission: state.getIn(['settings', 'notifications', 'alerts']).includes(true) && state.getIn(['notifications', 'browserSupport']) && state.getIn(['notifications', 'browserPermission']) === 'default' && !state.getIn(['settings', 'notifications', 'dismissPermissionBanner']), }); |