From dd1fe0917b7c252dd4d2e92b1a4f13f5336fe04d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?marcin=20miko=C5=82ajczak?= Date: Sat, 24 Aug 2024 14:33:30 +0200 Subject: [PATCH] Try to fix streaming notifications issue MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: marcin mikołajczak --- src/actions/notifications.ts | 4 ++-- src/components/status.tsx | 4 ---- src/containers/status-container.tsx | 4 ---- src/features/notifications/components/notification.tsx | 3 --- 4 files changed, 2 insertions(+), 13 deletions(-) diff --git a/src/actions/notifications.ts b/src/actions/notifications.ts index 1b66e984d2..521f9c4005 100644 --- a/src/actions/notifications.ts +++ b/src/actions/notifications.ts @@ -5,7 +5,7 @@ import { defineMessages } from 'react-intl'; import { getClient } from 'soapbox/api'; import { getNotificationStatus } from 'soapbox/features/notifications/components/notification'; -import { normalizeNotifications, type Notification } from 'soapbox/normalizers'; +import { normalizeNotification, normalizeNotifications, type Notification } from 'soapbox/normalizers'; import { getFilters, regexFromFilters } from 'soapbox/selectors'; import { isLoggedIn } from 'soapbox/utils/auth'; import { compareId } from 'soapbox/utils/comparators'; @@ -92,7 +92,7 @@ const updateNotifications = (notification: BaseNotification) => if (showInColumn) { dispatch({ type: NOTIFICATIONS_UPDATE, - notification, + notification: normalizeNotification(notification), }); fetchRelatedRelationships(dispatch, [notification]); diff --git a/src/components/status.tsx b/src/components/status.tsx index e99c31e13c..996cd3304c 100644 --- a/src/components/status.tsx +++ b/src/components/status.tsx @@ -25,9 +25,6 @@ import SensitiveContentOverlay from './statuses/sensitive-content-overlay'; import StatusInfo from './statuses/status-info'; import { Card, Icon, Stack, Text } from './ui'; -// Defined in components/scrollable-list -type ScrollPosition = { height: number; top: number }; - const messages = defineMessages({ reblogged_by: { id: 'status.reblogged_by', defaultMessage: '{name} reposted' }, }); @@ -458,7 +455,6 @@ const Status: React.FC = (props) => { }; export { - type ScrollPosition, type IStatus, Status as default, }; diff --git a/src/containers/status-container.tsx b/src/containers/status-container.tsx index 9f9e24cf23..52c1d71414 100644 --- a/src/containers/status-container.tsx +++ b/src/containers/status-container.tsx @@ -9,10 +9,6 @@ interface IStatusContainer extends Omit { contextType?: string; /** @deprecated Unused. */ otherAccounts?: any; - /** @deprecated Unused. */ - getScrollPosition?: any; - /** @deprecated Unused. */ - updateScrollBottom?: any; } /** diff --git a/src/features/notifications/components/notification.tsx b/src/features/notifications/components/notification.tsx index de8f8649d5..c835fac444 100644 --- a/src/features/notifications/components/notification.tsx +++ b/src/features/notifications/components/notification.tsx @@ -18,7 +18,6 @@ import { makeGetNotification } from 'soapbox/selectors'; import { NotificationType } from 'soapbox/utils/notification'; import type { Notification as BaseNotification } from 'pl-api'; -import type { ScrollPosition } from 'soapbox/components/status'; import type { Account, Notification as NotificationEntity, Status as StatusEntity } from 'soapbox/normalizers'; import type { MinifiedNotification } from 'soapbox/reducers/notifications'; @@ -174,8 +173,6 @@ interface INotification { onMoveUp?: (notificationId: string) => void; onMoveDown?: (notificationId: string) => void; onReblog?: (status: StatusEntity, e?: KeyboardEvent) => void; - getScrollPosition?: () => ScrollPosition | undefined; - updateScrollBottom?: (bottom: number) => void; } const getNotificationStatus = (n: NotificationEntity | BaseNotification) => {