瀏覽代碼

fix*(jaas) redirect to plan limit page on connection failed

j8
Tudor-Ovidiu Avram 3 年之前
父節點
當前提交
5a3607f63f
共有 1 個檔案被更改,包括 16 行新增2 行删除
  1. 16
    2
      react/features/jaas/middleware.web.js

+ 16
- 2
react/features/jaas/middleware.web.js 查看文件

1
 import { redirectToStaticPage } from '../app/actions';
1
 import { redirectToStaticPage } from '../app/actions';
2
 import { CONFERENCE_JOINED } from '../base/conference/actionTypes';
2
 import { CONFERENCE_JOINED } from '../base/conference/actionTypes';
3
+import { CONNECTION_FAILED } from '../base/connection';
4
+import { JitsiConnectionErrors } from '../base/lib-jitsi-meet';
3
 import { MiddlewareRegistry } from '../base/redux';
5
 import { MiddlewareRegistry } from '../base/redux';
4
 
6
 
5
 import { SET_DETAILS } from './actionTypes';
7
 import { SET_DETAILS } from './actionTypes';
6
 import { getCustomerDetails } from './actions';
8
 import { getCustomerDetails } from './actions';
7
 import { STATUSES } from './constants';
9
 import { STATUSES } from './constants';
8
 
10
 
11
+const redirectErrors = [
12
+    JitsiConnectionErrors.CONNECTION_DROPPED_ERROR,
13
+    JitsiConnectionErrors.PASSWORD_REQUIRED
14
+];
15
+
9
 /**
16
 /**
10
- * The redux middleware for billing counter.
17
+ * The redux middleware for jaas.
11
  *
18
  *
12
  * @param {Store} store - The redux store.
19
  * @param {Store} store - The redux store.
13
  * @returns {Function}
20
  * @returns {Function}
14
  */
21
  */
15
-
16
 MiddlewareRegistry.register(store => next => async action => {
22
 MiddlewareRegistry.register(store => next => async action => {
17
     switch (action.type) {
23
     switch (action.type) {
18
     case CONFERENCE_JOINED: {
24
     case CONFERENCE_JOINED: {
20
         break;
26
         break;
21
     }
27
     }
22
 
28
 
29
+    case CONNECTION_FAILED: {
30
+        const { error } = action;
31
+
32
+        if (error && redirectErrors.includes(error.name)) {
33
+            store.dispatch(redirectToStaticPage('/static/planLimit.html'));
34
+        }
35
+        break;
36
+    }
23
     case SET_DETAILS: {
37
     case SET_DETAILS: {
24
         const { status } = action.payload;
38
         const { status } = action.payload;
25
 
39
 

Loading…
取消
儲存