From 67d1c29d6a67b621b3072174395ff132037139ac Mon Sep 17 00:00:00 2001 From: Timo <16718859+toger5@users.noreply.github.com> Date: Thu, 5 Jan 2023 00:01:57 +0100 Subject: [PATCH] decrease wait after call ended to 10ms (#825) * decrease wait after call ended to 10ms * new order of widget requests to avoid pip flicker --- src/room/GroupCallView.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/room/GroupCallView.tsx b/src/room/GroupCallView.tsx index 8b086f21..e10c4df5 100644 --- a/src/room/GroupCallView.tsx +++ b/src/room/GroupCallView.tsx @@ -195,11 +195,11 @@ export function GroupCallView({ leave(); if (widget) { - // we need to wait until the callEnded event is tracked. Otherwise the iFrame gets killed before tracking the event. - await new Promise((resolve) => window.setTimeout(resolve, 500)); // 500ms + // we need to wait until the callEnded event is tracked. 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(); widget.api.transport.send(ElementWidgetActions.HangupCall, {}); - widget.api.setAlwaysOnScreen(false); } if (!isPasswordlessUser && !isEmbedded) {