mirror of
https://github.com/glitch-soc/mastodon.git
synced 2025-12-14 00:08:46 +00:00
[Glitch] Add ability for admins to force grouped notifications in web UI
Port c73868cd78 to glitch-soc
Signed-off-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
// @ts-check
|
||||
|
||||
import { selectUseGroupedNotifications } from 'flavours/glitch/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());
|
||||
|
||||
Reference in New Issue
Block a user