Skip to content

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

fix: Shows login warning for leaving only when in conference.

damenchoe5cd1b29fe29
diff --git a/react/features/authentication/middleware.ts b/react/features/authentication/middleware.ts
index 1349d634a6..7538b834b6 100644
--- a/react/features/authentication/middleware.ts
+++ b/react/features/authentication/middleware.ts
@@ -302,16 +302,23 @@ function _handleLogin({ dispatch, getState }: IStore) {
const tokenAuthServiceUrl = getTokenAuthUrl(config, room);
if (tokenAuthServiceUrl && LoginQuestionDialog) {
- dispatch(openDialog(LoginQuestionDialog, {
- handler: () => {
- // give time for the dialog to close
- setTimeout(() => {
- // we have already shown the prejoin screen, no need to show it again after obtaining the token
- window.location.href = `${tokenAuthServiceUrl}${
- tokenAuthServiceUrl.includes('#') ? '&' : '#'}skipPrejoin=true`;
- }, 500);
- }
- }));
+ const redirect = () => {
+ // we have already shown the prejoin screen, no need to show it again after obtaining the token
+ window.location.href = `${tokenAuthServiceUrl}${
+ tokenAuthServiceUrl.includes('#') ? '&' : '#'}skipPrejoin=true`;
+ };
+
+ // show warning for leaving conference only when in a conference
+ if (state['features/base/conference'].conference) {
+ dispatch(openDialog(LoginQuestionDialog, {
+ handler: () => {
+ // give time for the dialog to close
+ setTimeout(redirect, 500);
+ }
+ }));
+ } else {
+ redirect();
+ }
}
} else {
dispatch(openLoginDialog());