Add MatrixClientPeg::safeGet and use it in tests (#10985)

This commit is contained in:
Michael Telatynski 2023-06-05 18:12:23 +01:00 committed by GitHub
parent c47b587225
commit 6b46d6e4f8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
88 changed files with 290 additions and 226 deletions

View file

@ -15,7 +15,7 @@ limitations under the License.
*/
import React, { ReactNode } from "react";
import { MatrixEvent } from "matrix-js-sdk/src/matrix";
import { MatrixClient, MatrixEvent } from "matrix-js-sdk/src/matrix";
import { MatrixClientPeg } from "../../MatrixClientPeg";
import AccessibleButton from "../../components/views/elements/AccessibleButton";
@ -23,7 +23,7 @@ import { highlightEvent } from "../../utils/EventUtils";
import { _t } from "../../languageHandler";
import { getSenderName } from "../../utils/event/getSenderName";
export const textForVoiceBroadcastStoppedEvent = (event: MatrixEvent): (() => ReactNode) => {
export const textForVoiceBroadcastStoppedEvent = (event: MatrixEvent, client: MatrixClient): (() => ReactNode) => {
return (): ReactNode => {
const ownUserId = MatrixClientPeg.get()?.getUserId();
const startEventId = event.getRelation()?.event_id;