Collection notification filtering (#39198)

This commit is contained in:
Echo authored and GitHub committed 2026-05-28 20:13:56 +00:00
1 parent faa5944d46
commit 4101f567c5
9 files changed
+218 -8

No files matched your search

@@ -29,7 +29,10 @@ const filterNotificationsByAllowedTypes = (
(item) =>
item.type === 'gap' ||
allowedType === item.type ||
(allowedType === 'mention' && item.type === 'quote'),
(allowedType === 'mention' && item.type === 'quote') ||
(allowedType === 'collection' &&
(item.type === 'collection_update' ||
item.type === 'added_to_collection')),
);
};
+13 -4
View File
@@ -17,10 +17,19 @@ export const selectSettingsNotificationsShows = createSelector(
export const selectSettingsNotificationsExcludedTypes = createSelector(
[selectSettingsNotificationsShows],
(shows) =>
Object.entries(shows)
.filter(([_type, enabled]) => !enabled)
.map(([type, _enabled]) => type),
(shows) => {
const excludedTypes: string[] = [];
for (const key in shows) {
if (!shows[key]) {
if (key === 'collections') {
excludedTypes.push('collection_update', 'added_to_collection');
} else {
excludedTypes.push(key);
}
}
}
return excludedTypes;
},
);
export const selectSettingsNotificationsQuickFilterShow = (state: RootState) =>