Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

feat(base/conference): check conference status when leaving

Calin-Teodor4f371dfacccb
diff --git a/react/features/base/conference/actions.ts b/react/features/base/conference/actions.ts
index f932d3c4a9..9873edec57 100644
--- a/react/features/base/conference/actions.ts
+++ b/react/features/base/conference/actions.ts
@@ -1001,7 +1001,7 @@ export function setAssumedBandwidthBps(assumedBandwidthBps: number) {
export function redirect(vnode: string, focusJid: string, username: string) {
return (dispatch: IStore['dispatch'], getState: IStore['getState']) => {
const { conference, joining } = getState()['features/base/conference'];
-
+ const currentConference = conference || joining;
const newConfig = getVisitorOptions(getState, vnode, focusJid, username);
if (!newConfig) {
@@ -1011,7 +1011,7 @@ export function redirect(vnode: string, focusJid: string, username: string) {
}
dispatch(overwriteConfig(newConfig)) // @ts-ignore
- .then(() => dispatch(conferenceWillLeave(conference || joining, true)))
+ .then(() => currentConference && dispatch(conferenceWillLeave(currentConference, true)))
.then(() => dispatch(disconnect()))
.then(() => dispatch(setIAmVisitor(Boolean(vnode))))