Add ability for admins to force grouped notifications in web UI (#31610)
This commit is contained in:
parent
da42e9d446
commit
c73868cd78
9 changed files with 33 additions and 26 deletions
|
@ -1,5 +1,7 @@
|
|||
// @ts-check
|
||||
|
||||
import { selectUseGroupedNotifications } from 'mastodon/selectors/settings';
|
||||
|
||||
import { getLocale } from '../locales';
|
||||
import { connectStream } from '../stream';
|
||||
|
||||
|
@ -103,7 +105,7 @@ export const connectTimelineStream = (timelineId, channelName, params = {}, opti
|
|||
const notificationJSON = JSON.parse(data.payload);
|
||||
dispatch(updateNotifications(notificationJSON, messages, locale));
|
||||
// TODO: remove this once the groups feature replaces the previous one
|
||||
if(getState().settings.getIn(['notifications', 'groupingBeta'], false)) {
|
||||
if(selectUseGroupedNotifications(getState())) {
|
||||
dispatch(processNewNotificationForGroups(notificationJSON));
|
||||
}
|
||||
break;
|
||||
|
@ -112,7 +114,7 @@ export const connectTimelineStream = (timelineId, channelName, params = {}, opti
|
|||
const state = getState();
|
||||
if (state.notifications.top || !state.notifications.mounted)
|
||||
dispatch(expandNotifications({ forceLoad: true, maxId: undefined }));
|
||||
if(state.settings.getIn(['notifications', 'groupingBeta'], false)) {
|
||||
if (selectUseGroupedNotifications(state)) {
|
||||
dispatch(refreshStaleNotificationGroups());
|
||||
}
|
||||
break;
|
||||
|
@ -145,7 +147,7 @@ async function refreshHomeTimelineAndNotification(dispatch, getState) {
|
|||
await dispatch(expandHomeTimeline({ maxId: undefined }));
|
||||
|
||||
// TODO: remove this once the groups feature replaces the previous one
|
||||
if(getState().settings.getIn(['notifications', 'groupingBeta'], false)) {
|
||||
if(selectUseGroupedNotifications(getState())) {
|
||||
// TODO: polling for merged notifications
|
||||
try {
|
||||
await dispatch(pollRecentGroupNotifications());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue