From cc1f68296e84885a18a48828bbe7fc277744c53e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0imon=20Brandner?= Date: Thu, 24 Jun 2021 16:58:56 +0200 Subject: [PATCH] Iterate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Šimon Brandner --- src/TextForEvent.tsx | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/src/TextForEvent.tsx b/src/TextForEvent.tsx index 10c787bcb6..4721e13cec 100644 --- a/src/TextForEvent.tsx +++ b/src/TextForEvent.tsx @@ -473,19 +473,19 @@ function textForPowerEvent(event): () => string | null { }); } +const onPinnedMessagesClick = (): void => { + defaultDispatcher.dispatch({ + action: Action.SetRightPanelPhase, + phase: RightPanelPhases.PinnedMessages, + allowClose: false, + }); +} + function textForPinnedEvent(event: MatrixEvent, allowJSX: boolean): () => string | JSX.Element | null { if (!SettingsStore.getValue("feature_pinning")) return null; const senderName = event.sender ? event.sender.name : event.getSender(); if (allowJSX) { - const onPinnedMessagesClick = () => { - defaultDispatcher.dispatch({ - action: Action.SetRightPanelPhase, - phase: RightPanelPhases.PinnedMessages, - allowClose: false, - }); - } - return () => ( { @@ -498,10 +498,7 @@ function textForPinnedEvent(event: MatrixEvent, allowJSX: boolean): () => string ); } else { - return () => _t( - "%(senderName)s changed the pinned messages for the room.", - { senderName }, - ); + return () => _t("%(senderName)s changed the pinned messages for the room.", { senderName }); } }