mirror of
https://github.com/element-hq/element-web
synced 2024-11-28 04:21:57 +03:00
Fix custom hangup button
This commit is contained in:
parent
c56368cdbb
commit
7b93c56bd0
1 changed files with 4 additions and 4 deletions
|
@ -22,10 +22,10 @@ import {KJUR} from 'jsrsasign';
|
||||||
import {
|
import {
|
||||||
IOpenIDCredentials,
|
IOpenIDCredentials,
|
||||||
IWidgetApiRequest,
|
IWidgetApiRequest,
|
||||||
IWidgetApiRequestEmptyData,
|
|
||||||
VideoConferenceCapabilities,
|
VideoConferenceCapabilities,
|
||||||
WidgetApi
|
WidgetApi,
|
||||||
} from "matrix-widget-api";
|
} from "matrix-widget-api";
|
||||||
|
import { ElementWidgetActions } from "matrix-react-sdk/src/stores/widgets/ElementWidgetActions";
|
||||||
|
|
||||||
const JITSI_OPENIDTOKEN_JWT_AUTH = 'openidtoken-jwt';
|
const JITSI_OPENIDTOKEN_JWT_AUTH = 'openidtoken-jwt';
|
||||||
|
|
||||||
|
@ -76,7 +76,7 @@ let meetApi: any; // JitsiMeetExternalAPI
|
||||||
widgetApi.requestCapabilities(VideoConferenceCapabilities);
|
widgetApi.requestCapabilities(VideoConferenceCapabilities);
|
||||||
readyPromise = Promise.all([
|
readyPromise = Promise.all([
|
||||||
new Promise<void>(resolve => {
|
new Promise<void>(resolve => {
|
||||||
widgetApi.once<CustomEvent<IWidgetApiRequest>>("action:im.vector.ready", ev => {
|
widgetApi.once<CustomEvent<IWidgetApiRequest>>(`action:${ElementWidgetActions.ClientReady}`, ev => {
|
||||||
ev.preventDefault();
|
ev.preventDefault();
|
||||||
widgetApi.transport.reply(ev.detail, {});
|
widgetApi.transport.reply(ev.detail, {});
|
||||||
resolve();
|
resolve();
|
||||||
|
@ -116,7 +116,7 @@ let meetApi: any; // JitsiMeetExternalAPI
|
||||||
|
|
||||||
// TODO: register widgetApi listeners for PTT controls (https://github.com/vector-im/riot-web/issues/12795)
|
// TODO: register widgetApi listeners for PTT controls (https://github.com/vector-im/riot-web/issues/12795)
|
||||||
|
|
||||||
widgetApi.addEventListener('hangup', (ev: CustomEvent<IWidgetApiRequest>) => {
|
widgetApi.addEventListener(`action:${ElementWidgetActions.HangupCall}`, (ev: CustomEvent<IWidgetApiRequest>) => {
|
||||||
if (meetApi) meetApi.executeCommand('hangup');
|
if (meetApi) meetApi.executeCommand('hangup');
|
||||||
widgetApi.transport.reply(ev.detail, {}); // ack
|
widgetApi.transport.reply(ev.detail, {}); // ack
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue