Browse Source

code review

j8
Tudor-Ovidiu Avram 3 years ago
parent
commit
0ab905bf75
1 changed files with 10 additions and 6 deletions
  1. 10
    6
      react/features/jaas/middleware.web.js

+ 10
- 6
react/features/jaas/middleware.web.js View File

@@ -3,16 +3,12 @@ import { CONFERENCE_JOINED } from '../base/conference/actionTypes';
3 3
 import { CONNECTION_FAILED } from '../base/connection';
4 4
 import { JitsiConnectionErrors } from '../base/lib-jitsi-meet';
5 5
 import { MiddlewareRegistry } from '../base/redux';
6
+import { isVpaasMeeting } from '../billing-counter/functions';
6 7
 
7 8
 import { SET_DETAILS } from './actionTypes';
8 9
 import { getCustomerDetails } from './actions';
9 10
 import { STATUSES } from './constants';
10 11
 
11
-const redirectErrors = [
12
-    JitsiConnectionErrors.CONNECTION_DROPPED_ERROR,
13
-    JitsiConnectionErrors.PASSWORD_REQUIRED
14
-];
15
-
16 12
 /**
17 13
  * The redux middleware for jaas.
18 14
  *
@@ -29,7 +25,15 @@ MiddlewareRegistry.register(store => next => async action => {
29 25
     case CONNECTION_FAILED: {
30 26
         const { error } = action;
31 27
 
32
-        if (error && redirectErrors.includes(error.name)) {
28
+        if (!isVpaasMeeting(store.getState()) || !error) {
29
+            break;
30
+        }
31
+
32
+        if (error.name === JitsiConnectionErrors.PASSWORD_REQUIRED) {
33
+            if (error.message !== 'could not obtain public key') {
34
+                break;
35
+            }
36
+
33 37
             store.dispatch(redirectToStaticPage('/static/planLimit.html'));
34 38
         }
35 39
         break;

Loading…
Cancel
Save