diff --git a/app/soapbox/features/ads/components/ad.tsx b/app/soapbox/features/ads/components/ad.tsx index 6af45db24..4636795bc 100644 --- a/app/soapbox/features/ads/components/ad.tsx +++ b/app/soapbox/features/ads/components/ad.tsx @@ -85,7 +85,7 @@ const Ad: React.FC = ({ ad }) => { diff --git a/app/soapbox/features/groups/suggested.tsx b/app/soapbox/features/groups/suggested.tsx index 89833a9a8..8a3e570e0 100644 --- a/app/soapbox/features/groups/suggested.tsx +++ b/app/soapbox/features/groups/suggested.tsx @@ -13,7 +13,7 @@ import LayoutButtons, { GroupLayout } from './components/discover/layout-buttons import type { Group } from 'soapbox/schemas'; const messages = defineMessages({ - label: { id: 'groups.popular.label', defaultMessage: 'Suggested Groups' }, + label: { id: 'groups.suggested.label', defaultMessage: 'Suggested Groups' }, }); const GridList: Components['List'] = React.forwardRef((props, ref) => { diff --git a/app/soapbox/locales/en.json b/app/soapbox/locales/en.json index d46cf4ebf..f110df907 100644 --- a/app/soapbox/locales/en.json +++ b/app/soapbox/locales/en.json @@ -856,6 +856,7 @@ "groups.pending.label": "Pending Requests", "groups.popular.label": "Suggested Groups", "groups.search.placeholder": "Search My Groups", + "groups.suggested.label": "Suggested Groups", "groups.tags.title": "Browse Topics", "hashtag.column_header.tag_mode.all": "and {additional}", "hashtag.column_header.tag_mode.any": "or {additional}", diff --git a/app/soapbox/normalizers/notification.ts b/app/soapbox/normalizers/notification.ts index 2412db05d..45eb93fb3 100644 --- a/app/soapbox/normalizers/notification.ts +++ b/app/soapbox/normalizers/notification.ts @@ -25,8 +25,19 @@ export const NotificationRecord = ImmutableRecord({ total_count: null as number | null, // grouped notifications }); +const normalizeType = (notification: ImmutableMap) => { + if (notification.get('type') === 'group_mention') { + return notification.set('type', 'mention'); + } + + return notification; +}; + export const normalizeNotification = (notification: Record) => { return NotificationRecord( - ImmutableMap(fromJS(notification)), + ImmutableMap(fromJS(notification)) + .withMutations((notification: ImmutableMap) => { + normalizeType(notification); + }), ); }; diff --git a/app/soapbox/reducers/notifications.ts b/app/soapbox/reducers/notifications.ts index 24185ee0a..f563fce83 100644 --- a/app/soapbox/reducers/notifications.ts +++ b/app/soapbox/reducers/notifications.ts @@ -88,12 +88,12 @@ const isValid = (notification: APIEntity) => { } // https://gitlab.com/soapbox-pub/soapbox/-/issues/424 - if (!notification.account.id) { + if (!notification.account.get('id')) { return false; } // Mastodon can return status notifications with a null status - if (['mention', 'reblog', 'favourite', 'poll', 'status'].includes(notification.type) && !notification.status.id) { + if (['mention', 'reblog', 'favourite', 'poll', 'status'].includes(notification.type) && !notification.status.get('id')) { return false; } @@ -131,6 +131,7 @@ const importNotification = (state: State, notification: APIEntity) => { export const processRawNotifications = (notifications: APIEntity[]) => ( ImmutableOrderedMap( notifications + .map(normalizeNotification) .filter(isValid) .map(n => [n.id, fixNotification(n)]), ));