mirror of
https://github.com/vector-im/element-web.git
synced 2024-11-15 20:54:59 +08:00
Tidy
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
parent
dd17436eb0
commit
5a1b38cd74
@ -195,18 +195,22 @@ const setupCompleted = (async (): Promise<string | void> => {
|
|||||||
handleAction(ElementWidgetActions.DeviceMute, async (params) => {
|
handleAction(ElementWidgetActions.DeviceMute, async (params) => {
|
||||||
if (!meetApi) return;
|
if (!meetApi) return;
|
||||||
|
|
||||||
|
const [audioEnabled, videoEnabled] = (
|
||||||
|
await Promise.all([meetApi.isAudioMuted(), meetApi.isVideoMuted()])
|
||||||
|
).map((muted) => !muted);
|
||||||
|
|
||||||
if (Object.keys(params).length === 0) {
|
if (Object.keys(params).length === 0) {
|
||||||
// Handle query
|
// Handle query
|
||||||
return {
|
return {
|
||||||
audio_enabled: !(await meetApi.isAudioMuted()),
|
audio_enabled: audioEnabled,
|
||||||
video_enabled: !(await meetApi.isVideoMuted()),
|
video_enabled: videoEnabled,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
if (params.audio_enabled !== !(await meetApi.isAudioMuted())) {
|
if (params.audio_enabled !== audioEnabled) {
|
||||||
meetApi.executeCommand("toggleAudio");
|
meetApi.executeCommand("toggleAudio");
|
||||||
}
|
}
|
||||||
if (params.video_enabled !== !(await meetApi.isVideoMuted())) {
|
if (params.video_enabled !== videoEnabled) {
|
||||||
meetApi.executeCommand("toggleVideo");
|
meetApi.executeCommand("toggleVideo");
|
||||||
}
|
}
|
||||||
return params;
|
return params;
|
||||||
|
Loading…
Reference in New Issue
Block a user