Enable grouped notifications unconditionally (#31929)
This commit is contained in:
parent
e0648a916a
commit
c620452fd7
10 changed files with 16 additions and 70 deletions
|
@ -1,7 +1,5 @@
|
|||
// @ts-check
|
||||
|
||||
import { selectUseGroupedNotifications } from 'mastodon/selectors/settings';
|
||||
|
||||
import { getLocale } from '../locales';
|
||||
import { connectStream } from '../stream';
|
||||
|
||||
|
@ -105,18 +103,14 @@ 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(selectUseGroupedNotifications(getState())) {
|
||||
dispatch(processNewNotificationForGroups(notificationJSON));
|
||||
}
|
||||
dispatch(processNewNotificationForGroups(notificationJSON));
|
||||
break;
|
||||
}
|
||||
case 'notifications_merged':
|
||||
const state = getState();
|
||||
if (state.notifications.top || !state.notifications.mounted)
|
||||
dispatch(expandNotifications({ forceLoad: true, maxId: undefined }));
|
||||
if (selectUseGroupedNotifications(state)) {
|
||||
dispatch(refreshStaleNotificationGroups());
|
||||
}
|
||||
dispatch(refreshStaleNotificationGroups());
|
||||
break;
|
||||
case 'conversation':
|
||||
// @ts-expect-error
|
||||
|
@ -141,21 +135,15 @@ export const connectTimelineStream = (timelineId, channelName, params = {}, opti
|
|||
|
||||
/**
|
||||
* @param {Function} dispatch
|
||||
* @param {Function} getState
|
||||
*/
|
||||
async function refreshHomeTimelineAndNotification(dispatch, getState) {
|
||||
async function refreshHomeTimelineAndNotification(dispatch) {
|
||||
await dispatch(expandHomeTimeline({ maxId: undefined }));
|
||||
|
||||
// TODO: remove this once the groups feature replaces the previous one
|
||||
if(selectUseGroupedNotifications(getState())) {
|
||||
// TODO: polling for merged notifications
|
||||
try {
|
||||
await dispatch(pollRecentGroupNotifications());
|
||||
} catch {
|
||||
// TODO
|
||||
}
|
||||
} else {
|
||||
await dispatch(expandNotifications({}));
|
||||
// TODO: polling for merged notifications
|
||||
try {
|
||||
await dispatch(pollRecentGroupNotifications());
|
||||
} catch {
|
||||
// TODO
|
||||
}
|
||||
|
||||
await dispatch(fetchAnnouncements());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue