[Glitch] Fix notifications being unnecessarily redrawn on state change
Port 772f525c90
to glitch-soc
Co-authored-by: Claire <claire.github-309c@sitedethib.com>
Signed-off-by: Claire <claire.github-309c@sitedethib.com>
lolsob-rspec
parent
2736b1f95e
commit
eab7d380e9
|
@ -37,10 +37,16 @@ const messages = defineMessages({
|
||||||
markAsRead : { id: 'notifications.mark_as_read', defaultMessage: 'Mark every notification as read' },
|
markAsRead : { id: 'notifications.mark_as_read', defaultMessage: 'Mark every notification as read' },
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const getExcludedTypes = createSelector([
|
||||||
|
state => state.getIn(['settings', 'notifications', 'shows']),
|
||||||
|
], (shows) => {
|
||||||
|
return ImmutableList(shows.filter(item => !item).keys());
|
||||||
|
});
|
||||||
|
|
||||||
const getNotifications = createSelector([
|
const getNotifications = createSelector([
|
||||||
state => state.getIn(['settings', 'notifications', 'quickFilter', 'show']),
|
state => state.getIn(['settings', 'notifications', 'quickFilter', 'show']),
|
||||||
state => state.getIn(['settings', 'notifications', 'quickFilter', 'active']),
|
state => state.getIn(['settings', 'notifications', 'quickFilter', 'active']),
|
||||||
state => ImmutableList(state.getIn(['settings', 'notifications', 'shows']).filter(item => !item).keys()),
|
getExcludedTypes,
|
||||||
state => state.getIn(['notifications', 'items']),
|
state => state.getIn(['notifications', 'items']),
|
||||||
], (showFilterBar, allowedType, excludedTypes, notifications) => {
|
], (showFilterBar, allowedType, excludedTypes, notifications) => {
|
||||||
if (!showFilterBar || allowedType === 'all') {
|
if (!showFilterBar || allowedType === 'all') {
|
||||||
|
|
Loading…
Reference in New Issue