From 2a5106fb1f52b1774925681f7cb7ff7e9d1665b1 Mon Sep 17 00:00:00 2001 From: mkljczk Date: Sun, 2 Mar 2025 17:52:43 +0100 Subject: [PATCH] pl-fe: why this was a function Signed-off-by: mkljczk --- .../notifications/components/notification.tsx | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/packages/pl-fe/src/features/notifications/components/notification.tsx b/packages/pl-fe/src/features/notifications/components/notification.tsx index 072575f8c..280cf0264 100644 --- a/packages/pl-fe/src/features/notifications/components/notification.tsx +++ b/packages/pl-fe/src/features/notifications/components/notification.tsx @@ -217,18 +217,6 @@ const Notification: React.FC = (props) => { const { accounts } = notification; const account = accounts[0]; - const getHandlers = () => ({ - reply: handleReply, - favourite: handleHotkeyFavourite, - boost: handleHotkeyBoost, - mention: handleMention, - open: handleOpen, - openProfile: handleOpenProfile, - moveUp: handleMoveUp, - moveDown: handleMoveDown, - toggleSensitive: handleHotkeyToggleSensitive, - }); - const handleOpen = () => { if (status && typeof status === 'object' && account && typeof account === 'object') { history.push(`/@${account.acct}/posts/${status.id}`); @@ -307,6 +295,18 @@ const Notification: React.FC = (props) => { } }; + const handlers = { + reply: handleReply, + favourite: handleHotkeyFavourite, + boost: handleHotkeyBoost, + mention: handleMention, + open: handleOpen, + openProfile: handleOpenProfile, + moveUp: handleMoveUp, + moveDown: handleMoveDown, + toggleSensitive: handleHotkeyToggleSensitive, + }; + const displayedType = notification.type === 'mention' && (notification.subtype === 'reply' || status?.in_reply_to_account_id === me) ? 'reply' : notification.type; const renderIcon = (): React.ReactNode => { @@ -402,7 +402,7 @@ const Notification: React.FC = (props) => { ); return ( - +