Skip to content
This repository was archived by the owner on Dec 21, 2023. It is now read-only.

Commit 9669167

Browse files
Fix notifications being unnecessarily redrawn on state change (mastodon#15312)
Co-authored-by: Claire <[email protected]>
1 parent 127c543 commit 9669167

File tree

1 file changed

+7
-1
lines changed
  • app/javascript/mastodon/features/notifications

1 file changed

+7
-1
lines changed

app/javascript/mastodon/features/notifications/index.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,16 @@ const messages = defineMessages({
3232
markAsRead : { id: 'notifications.mark_as_read', defaultMessage: 'Mark every notification as read' },
3333
});
3434

35+
const getExcludedTypes = createSelector([
36+
state => state.getIn(['settings', 'notifications', 'shows']),
37+
], (shows) => {
38+
return ImmutableList(shows.filter(item => !item).keys());
39+
});
40+
3541
const getNotifications = createSelector([
3642
state => state.getIn(['settings', 'notifications', 'quickFilter', 'show']),
3743
state => state.getIn(['settings', 'notifications', 'quickFilter', 'active']),
38-
state => ImmutableList(state.getIn(['settings', 'notifications', 'shows']).filter(item => !item).keys()),
44+
getExcludedTypes,
3945
state => state.getIn(['notifications', 'items']),
4046
], (showFilterBar, allowedType, excludedTypes, notifications) => {
4147
if (!showFilterBar || allowedType === 'all') {

0 commit comments

Comments
 (0)