Merge pull request #1002 from vector-im/dbkr/fix_posthog_embedded_mode

Fix PostHog in embedded mode
This commit is contained in:
David Baker 2023-04-17 19:42:02 +01:00 committed by GitHub
commit f627835646
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -143,7 +143,7 @@ export function GroupCallView({
groupCall.setLocalVideoMuted(videoInput === null),
]);
await groupCall.enter();
await enter();
PosthogAnalytics.instance.eventCallEnded.cacheStartCall(new Date());
PosthogAnalytics.instance.eventCallStarted.track(groupCall.groupCallId);
@ -158,17 +158,17 @@ export function GroupCallView({
widget.lazyActions.off(ElementWidgetActions.JoinCall, onJoin);
};
}
}, [groupCall, preload, setAudioInput, setVideoInput]);
}, [groupCall, preload, setAudioInput, setVideoInput, enter]);
useEffect(() => {
if (isEmbedded && !preload) {
// In embedded mode, bypass the lobby and just enter the call straight away
groupCall.enter();
enter();
PosthogAnalytics.instance.eventCallEnded.cacheStartCall(new Date());
PosthogAnalytics.instance.eventCallStarted.track(groupCall.groupCallId);
}
}, [groupCall, isEmbedded, preload]);
}, [groupCall, isEmbedded, preload, enter]);
useSentryGroupCallHandler(groupCall);