|
@@ -1,18 +1,24 @@
|
1
|
1
|
import { redirectToStaticPage } from '../app/actions';
|
2
|
2
|
import { CONFERENCE_JOINED } from '../base/conference/actionTypes';
|
|
3
|
+import { CONNECTION_FAILED } from '../base/connection';
|
|
4
|
+import { JitsiConnectionErrors } from '../base/lib-jitsi-meet';
|
3
|
5
|
import { MiddlewareRegistry } from '../base/redux';
|
4
|
6
|
|
5
|
7
|
import { SET_DETAILS } from './actionTypes';
|
6
|
8
|
import { getCustomerDetails } from './actions';
|
7
|
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
|
19
|
* @param {Store} store - The redux store.
|
13
|
20
|
* @returns {Function}
|
14
|
21
|
*/
|
15
|
|
-
|
16
|
22
|
MiddlewareRegistry.register(store => next => async action => {
|
17
|
23
|
switch (action.type) {
|
18
|
24
|
case CONFERENCE_JOINED: {
|
|
@@ -20,6 +26,14 @@ MiddlewareRegistry.register(store => next => async action => {
|
20
|
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
|
37
|
case SET_DETAILS: {
|
24
|
38
|
const { status } = action.payload;
|
25
|
39
|
|