From d26afd8769ac1c67772c91e8cf7b11cf3f1aa7d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?nicole=20miko=C5=82ajczyk?= Date: Fri, 27 Feb 2026 16:48:48 +0100 Subject: [PATCH] nicolium: avoid surpressing errors MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: nicole mikołajczyk --- .../notifications/use-notifications.ts | 31 ++++++++++--------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/packages/nicolium/src/queries/notifications/use-notifications.ts b/packages/nicolium/src/queries/notifications/use-notifications.ts index f9340b181..d7f1a13a1 100644 --- a/packages/nicolium/src/queries/notifications/use-notifications.ts +++ b/packages/nicolium/src/queries/notifications/use-notifications.ts @@ -40,20 +40,23 @@ const FILTER_TYPES = { type FilterType = keyof typeof FILTER_TYPES; -const normalizeNotification = (notification: Notification): NotificationGroup => ({ - ...omit(notification, ['account', 'status', 'target']), - group_key: notification.id, - notifications_count: 1, - most_recent_notification_id: notification.id, - page_min_id: notification.id, - page_max_id: notification.id, - latest_page_notification_at: notification.created_at, - sample_account_ids: [notification.account.id], - // @ts-expect-error - status_id: notification.status?.id, - // @ts-expect-error - target_id: notification.target?.id, -}); +const normalizeNotification = (notification: Notification): NotificationGroup => { + const base = { + ...omit(notification, ['account', 'status', 'target']), + group_key: notification.id, + notifications_count: 1, + most_recent_notification_id: notification.id, + page_min_id: notification.id, + page_max_id: notification.id, + latest_page_notification_at: notification.created_at, + sample_account_ids: [notification.account.id], + }; + + return Object.assign(base, { + status_id: 'status' in notification ? notification.status?.id : undefined, + target_id: 'target' in notification ? notification.target?.id : undefined, + }) as NotificationGroup; +}; const useActiveFilter = () => useSettingsStore((state) => state.settings.notifications.quickFilter.active);