diff --git a/src/utils/EventUtils.ts b/src/utils/EventUtils.ts index 5858f2aaf4..eeebabd5c1 100644 --- a/src/utils/EventUtils.ts +++ b/src/utils/EventUtils.ts @@ -31,7 +31,7 @@ import defaultDispatcher from "../dispatcher/dispatcher"; import { TimelineRenderingType } from "../contexts/RoomContext"; import { launchPollEditor } from "../components/views/messages/MPollBody"; import { Action } from "../dispatcher/actions"; -import { ViewRoomPayload } from '../dispatcher/payloads/ViewRoomPayload'; +import { ViewRoomPayload } from "../dispatcher/payloads/ViewRoomPayload"; /** * Returns whether an event should allow actions like reply, reactions, edit, etc. diff --git a/src/voice-broadcast/utils/shouldDisplayAsVoiceBroadcastStoppedText.ts b/src/voice-broadcast/utils/shouldDisplayAsVoiceBroadcastStoppedText.ts index 81219b044a..22d6e79c37 100644 --- a/src/voice-broadcast/utils/shouldDisplayAsVoiceBroadcastStoppedText.ts +++ b/src/voice-broadcast/utils/shouldDisplayAsVoiceBroadcastStoppedText.ts @@ -18,8 +18,7 @@ import { MatrixEvent } from "matrix-js-sdk/src/matrix"; import { VoiceBroadcastInfoEventType, VoiceBroadcastInfoState } from ".."; -export const shouldDisplayAsVoiceBroadcastStoppedText = (event: MatrixEvent): boolean => ( - event.getType() === VoiceBroadcastInfoEventType - && event.getContent()?.state === VoiceBroadcastInfoState.Stopped - && !event.isRedacted() -); +export const shouldDisplayAsVoiceBroadcastStoppedText = (event: MatrixEvent): boolean => + event.getType() === VoiceBroadcastInfoEventType && + event.getContent()?.state === VoiceBroadcastInfoState.Stopped && + !event.isRedacted(); diff --git a/src/voice-broadcast/utils/textForVoiceBroadcastStoppedEvent.tsx b/src/voice-broadcast/utils/textForVoiceBroadcastStoppedEvent.tsx index 5c42c3e17e..611908b750 100644 --- a/src/voice-broadcast/utils/textForVoiceBroadcastStoppedEvent.tsx +++ b/src/voice-broadcast/utils/textForVoiceBroadcastStoppedEvent.tsx @@ -23,33 +23,27 @@ import { highlightEvent } from "../../utils/EventUtils"; import { getSenderName } from "../../TextForEvent"; import { _t } from "../../languageHandler"; -export const textForVoiceBroadcastStoppedEvent = (event: MatrixEvent): () => ReactNode => { +export const textForVoiceBroadcastStoppedEvent = (event: MatrixEvent): (() => ReactNode) => { return (): ReactNode => { const ownUserId = MatrixClientPeg.get()?.getUserId(); const startEventId = event.getRelation()?.event_id; const roomId = event.getRoomId(); const templateTags = { - a: (text: string) => startEventId && roomId - ? ( - highlightEvent(roomId, startEventId)} - > - { text } + a: (text: string) => + startEventId && roomId ? ( + highlightEvent(roomId, startEventId)}> + {text} - ) - : text, + ) : ( + text + ), }; if (ownUserId && ownUserId === event.getSender()) { return _t("You ended a voice broadcast", {}, templateTags); } - return _t( - "%(senderName)s ended a voice broadcast", - { senderName: getSenderName(event) }, - templateTags, - ); + return _t("%(senderName)s ended a voice broadcast", { senderName: getSenderName(event) }, templateTags); }; }; diff --git a/test/voice-broadcast/utils/textForVoiceBroadcastStoppedEvent-test.tsx b/test/voice-broadcast/utils/textForVoiceBroadcastStoppedEvent-test.tsx index 03fe525abc..0359396282 100644 --- a/test/voice-broadcast/utils/textForVoiceBroadcastStoppedEvent-test.tsx +++ b/test/voice-broadcast/utils/textForVoiceBroadcastStoppedEvent-test.tsx @@ -16,7 +16,7 @@ limitations under the License. import React from "react"; import { render, RenderResult, screen } from "@testing-library/react"; -import userEvent from '@testing-library/user-event'; +import userEvent from "@testing-library/user-event"; import { mocked } from "jest-mock"; import { MatrixClient, RelationType } from "matrix-js-sdk/src/matrix"; @@ -48,7 +48,7 @@ describe("textForVoiceBroadcastStoppedEvent", () => { }; } - return render(
{ textForVoiceBroadcastStoppedEvent(event)() }
); + return render(
{textForVoiceBroadcastStoppedEvent(event)()}
); }; beforeEach(() => {