Fix not hanging up when using the close button (EXA EXI) (#1840)
--------- Signed-off-by: Timo K <toger5@hotmail.de>
This commit is contained in:
@@ -218,17 +218,6 @@ export const GroupCallView: FC<Props> = ({
|
||||
);
|
||||
|
||||
await leaveRTCSession(rtcSession);
|
||||
if (widget) {
|
||||
// we need to wait until the callEnded event is tracked on posthog.
|
||||
// Otherwise the iFrame gets killed before the callEnded event got tracked.
|
||||
await new Promise((resolve) => window.setTimeout(resolve, 10)); // 10ms
|
||||
widget.api.setAlwaysOnScreen(false);
|
||||
PosthogAnalytics.instance.logout();
|
||||
|
||||
// we will always send the hangup event after the memberships have been updated
|
||||
// calling leaveRTCSession.
|
||||
widget.api.transport.send(ElementWidgetActions.HangupCall, {});
|
||||
}
|
||||
|
||||
if (
|
||||
!isPasswordlessUser &&
|
||||
@@ -246,9 +235,8 @@ export const GroupCallView: FC<Props> = ({
|
||||
const onHangup = async (
|
||||
ev: CustomEvent<IWidgetApiRequest>,
|
||||
): Promise<void> => {
|
||||
leaveRTCSession(rtcSession);
|
||||
widget!.api.transport.reply(ev.detail, {});
|
||||
widget!.api.setAlwaysOnScreen(false);
|
||||
await leaveRTCSession(rtcSession);
|
||||
};
|
||||
widget.lazyActions.once(ElementWidgetActions.HangupCall, onHangup);
|
||||
return () => {
|
||||
|
||||
Reference in New Issue
Block a user