Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fully close Jitsi conferences on errors #22060

Merged
merged 1 commit into from
May 5, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 12 additions & 8 deletions src/vector/jitsi/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,15 @@ async function notifyHangup() {
}
}

function closeConference() {
switchVisibleContainers();
document.getElementById("jitsiContainer").innerHTML = "";

if (skipOurWelcomeScreen) {
skipToJitsiSplashScreen();
}
}

// event handler bound in HTML
function joinConference(audioDevice?: string, videoDevice?: string) {
let jwt;
Expand Down Expand Up @@ -386,20 +395,15 @@ function joinConference(audioDevice?: string, videoDevice?: string) {
meetApi = null;
});

meetApi.on("readyToClose", () => {
switchVisibleContainers();
document.getElementById("jitsiContainer").innerHTML = "";

if (skipOurWelcomeScreen) {
skipToJitsiSplashScreen();
}
});
meetApi.on("readyToClose", closeConference);

meetApi.on("errorOccurred", ({ error }) => {
if (error.isFatal) {
// We got disconnected. Since Jitsi Meet might send us back to the
// prejoin screen, we're forced to act as if we hung up entirely.
notifyHangup();
meetApi = null;
closeConference();
}
});

Expand Down