Strictify voice-broadcast (#10393)

This commit is contained in:
Michael Weimann 2023-03-16 10:55:06 +01:00 committed by GitHub
parent 6d15b05b86
commit aae9dfbb7d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 69 additions and 23 deletions

View file

@ -1,5 +1,5 @@
/*
Copyright 2022 The Matrix.org Foundation C.I.C.
Copyright 2022-2023 The Matrix.org Foundation C.I.C.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@ -66,6 +66,12 @@ export const useVoiceBroadcastRecording = (
throw new Error("Unable to find voice broadcast room with Id: " + roomId);
}
const sender = recording.infoEvent.sender;
if (!sender) {
throw new Error(`Voice Broadcast sender not found (event ${recording.infoEvent.getId()})`);
}
const stopRecording = async (): Promise<void> => {
const confirmed = await showStopBroadcastingDialog();
@ -99,7 +105,7 @@ export const useVoiceBroadcastRecording = (
timeLeft,
recordingState,
room,
sender: recording.infoEvent.sender,
sender,
stopRecording,
toggleRecording: recording.toggle,
};