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(auth.native): trigger conference left on cancel

paweldomasdedd10c62ab0
diff --git a/react/features/authentication/actions.js b/react/features/authentication/actions.js
index 4dc7439d2b..b0ec8077e5 100644
--- a/react/features/authentication/actions.js
+++ b/react/features/authentication/actions.js
@@ -1,7 +1,7 @@
// @flow
import { appNavigate } from '../app';
-import { checkIfCanJoin } from '../base/conference';
+import { checkIfCanJoin, conferenceLeft } from '../base/conference';
import { openDialog } from '../base/dialog';
import {
@@ -82,8 +82,14 @@ export function cancelLogin() {
* @returns {Function}
*/
export function cancelWaitForOwner() {
- return (dispatch: Dispatch<*>) => {
+ return (dispatch: Dispatch<*>, getState: Function) => {
dispatch(stopWaitForOwner());
+ const { authRequired } = getState()['features/base/conference'];
+
+ if (authRequired) {
+ dispatch(conferenceLeft(authRequired));
+ }
+
dispatch(appNavigate(undefined));
};
}
diff --git a/react/features/base/conference/reducer.js b/react/features/base/conference/reducer.js
index 1d109449f6..2b3bf81149 100644
--- a/react/features/base/conference/reducer.js
+++ b/react/features/base/conference/reducer.js
@@ -183,19 +183,31 @@ function _conferenceJoined(state, { conference }) {
* reduction of the specified action.
*/
function _conferenceLeft(state, { conference }) {
- if (state.conference !== conference) {
- return state;
+ let output = state;
+
+ if (state.authRequired === conference) {
+ output = set(output, 'authRequired', undefined);
+ }
+ if (state.conference === conference) {
+ output = assign(output, {
+ conference: undefined,
+ joining: undefined,
+ leaving: undefined
+ });
+ }
+ if (state.passwordRequired === conference) {
+ // Note that in case the conference was joined those fields have been
+ // cleared already, so this step needs to be done only if the room
+ // unlock operation has been canceled and that's why it's not done in
+ // the 'state.conference' condition above.
+ output = assign(output, {
+ locked: undefined,
+ password: undefined,
+ passwordRequired: undefined
+ });
}
- return assign(state, {
- authRequired: undefined,
- conference: undefined,
- joining: undefined,
- leaving: undefined,
- locked: undefined,
- password: undefined,
- passwordRequired: undefined
- });
+ return output;
}
/**