Add ability for admins to force grouped notifications in web UI (#31610)

This commit is contained in:
Claire 2024-08-27 16:55:51 +02:00 committed by GitHub
parent da42e9d446
commit c73868cd78
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 33 additions and 26 deletions

View file

@ -1,3 +1,4 @@
import { forceGroupedNotifications } from 'mastodon/initial_state';
import type { RootState } from 'mastodon/store';
/* eslint-disable @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access */
@ -25,6 +26,10 @@ export const selectSettingsNotificationsQuickFilterAdvanced = (
) =>
state.settings.getIn(['notifications', 'quickFilter', 'advanced']) as boolean;
export const selectUseGroupedNotifications = (state: RootState) =>
forceGroupedNotifications ||
(state.settings.getIn(['notifications', 'groupingBeta']) as boolean);
export const selectSettingsNotificationsShowUnread = (state: RootState) =>
state.settings.getIn(['notifications', 'showUnread']) as boolean;