Merge remote-tracking branch 'parent/main' into upstream-20240828

This commit is contained in:
KMY 2024-08-28 20:26:35 +09:00
commit b39054ff3c
136 changed files with 1803 additions and 977 deletions

View file

@ -1,5 +1,7 @@
// @ts-check
import { selectUseGroupedNotifications } from 'mastodon/selectors/settings';
import { getLocale } from '../locales';
import { connectStream } from '../stream';
@ -104,7 +106,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;
@ -117,7 +119,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;
@ -150,7 +152,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());