Apply prettier formatting
This commit is contained in:
parent
1cac306093
commit
526645c791
1576 changed files with 65385 additions and 62478 deletions
|
@ -16,11 +16,7 @@ limitations under the License.
|
|||
|
||||
import React, { useState } from "react";
|
||||
|
||||
import {
|
||||
VoiceBroadcastInfoState,
|
||||
VoiceBroadcastRecording,
|
||||
VoiceBroadcastRecordingEvent,
|
||||
} from "..";
|
||||
import { VoiceBroadcastInfoState, VoiceBroadcastRecording, VoiceBroadcastRecordingEvent } from "..";
|
||||
import QuestionDialog from "../../components/views/dialogs/QuestionDialog";
|
||||
import { useTypedEventEmitter } from "../../hooks/useEventEmitter";
|
||||
import { _t } from "../../languageHandler";
|
||||
|
@ -28,19 +24,18 @@ import { MatrixClientPeg } from "../../MatrixClientPeg";
|
|||
import Modal from "../../Modal";
|
||||
|
||||
const showStopBroadcastingDialog = async (): Promise<boolean> => {
|
||||
const { finished } = Modal.createDialog(
|
||||
QuestionDialog,
|
||||
{
|
||||
title: _t("Stop live broadcasting?"),
|
||||
description: (
|
||||
<p>
|
||||
{ _t("Are you sure you want to stop your live broadcast?"
|
||||
+ "This will end the broadcast and the full recording will be available in the room.") }
|
||||
</p>
|
||||
),
|
||||
button: _t("Yes, stop broadcast"),
|
||||
},
|
||||
);
|
||||
const { finished } = Modal.createDialog(QuestionDialog, {
|
||||
title: _t("Stop live broadcasting?"),
|
||||
description: (
|
||||
<p>
|
||||
{_t(
|
||||
"Are you sure you want to stop your live broadcast?" +
|
||||
"This will end the broadcast and the full recording will be available in the room.",
|
||||
)}
|
||||
</p>
|
||||
),
|
||||
button: _t("Yes, stop broadcast"),
|
||||
});
|
||||
const [confirmed] = await finished;
|
||||
return confirmed;
|
||||
};
|
||||
|
@ -72,16 +67,9 @@ export const useVoiceBroadcastRecording = (recording: VoiceBroadcastRecording) =
|
|||
);
|
||||
|
||||
const [timeLeft, setTimeLeft] = useState(recording.getTimeLeft());
|
||||
useTypedEventEmitter(
|
||||
recording,
|
||||
VoiceBroadcastRecordingEvent.TimeLeftChanged,
|
||||
setTimeLeft,
|
||||
);
|
||||
useTypedEventEmitter(recording, VoiceBroadcastRecordingEvent.TimeLeftChanged, setTimeLeft);
|
||||
|
||||
const live = [
|
||||
VoiceBroadcastInfoState.Started,
|
||||
VoiceBroadcastInfoState.Resumed,
|
||||
].includes(recordingState);
|
||||
const live = [VoiceBroadcastInfoState.Started, VoiceBroadcastInfoState.Resumed].includes(recordingState);
|
||||
|
||||
return {
|
||||
live,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue