Sfoglia il codice sorgente

CONFERENCE_FAILED error as object

master
Lyubo Marinov 7 anni fa
parent
commit
c98e7a204c

+ 2
- 1
react/features/authentication/middleware.js Vedi File

75
     }
75
     }
76
 
76
 
77
     case CONFERENCE_FAILED:
77
     case CONFERENCE_FAILED:
78
-        if (action.error === JitsiConferenceErrors.AUTHENTICATION_REQUIRED) {
78
+        if (action.error.name
79
+                === JitsiConferenceErrors.AUTHENTICATION_REQUIRED) {
79
             store.dispatch(waitForOwner());
80
             store.dispatch(waitForOwner());
80
         } else {
81
         } else {
81
             store.dispatch(stopWaitForOwner());
82
             store.dispatch(stopWaitForOwner());

+ 1
- 1
react/features/base/conference/actionTypes.js Vedi File

4
  * {
4
  * {
5
  *     type: CONFERENCE_FAILED,
5
  *     type: CONFERENCE_FAILED,
6
  *     conference: JitsiConference,
6
  *     conference: JitsiConference,
7
- *     error: string
7
+ *     error: Error
8
  * }
8
  * }
9
  */
9
  */
10
 export const CONFERENCE_FAILED = Symbol('CONFERENCE_FAILED');
10
 export const CONFERENCE_FAILED = Symbol('CONFERENCE_FAILED');

+ 7
- 2
react/features/base/conference/actions.js Vedi File

159
  * @returns {{
159
  * @returns {{
160
  *     type: CONFERENCE_FAILED,
160
  *     type: CONFERENCE_FAILED,
161
  *     conference: JitsiConference,
161
  *     conference: JitsiConference,
162
- *     error: string
162
+ *     error: Error
163
  * }}
163
  * }}
164
  * @public
164
  * @public
165
  */
165
  */
167
     return {
167
     return {
168
         type: CONFERENCE_FAILED,
168
         type: CONFERENCE_FAILED,
169
         conference,
169
         conference,
170
-        error
170
+
171
+        // Make the error resemble an Error instance (to the extent that
172
+        // jitsi-meet needs it).
173
+        error: {
174
+            name: error
175
+        }
171
     };
176
     };
172
 }
177
 }
173
 
178
 

+ 1
- 1
react/features/base/conference/reducer.js Vedi File

89
     let authRequired;
89
     let authRequired;
90
     let passwordRequired;
90
     let passwordRequired;
91
 
91
 
92
-    switch (error) {
92
+    switch (error.name) {
93
     case JitsiConferenceErrors.AUTHENTICATION_REQUIRED:
93
     case JitsiConferenceErrors.AUTHENTICATION_REQUIRED:
94
         authRequired = conference;
94
         authRequired = conference;
95
         break;
95
         break;

+ 11
- 3
react/features/overlay/reducer.js Vedi File

56
  * @returns {Object} The new state of the feature overlay after the reduction of
56
  * @returns {Object} The new state of the feature overlay after the reduction of
57
  * the specified action.
57
  * the specified action.
58
  */
58
  */
59
-function _conferenceFailed(state, { error, message }) {
60
-    if (error === JitsiConferenceErrors.FOCUS_LEFT
61
-            || error === JitsiConferenceErrors.VIDEOBRIDGE_NOT_AVAILABLE) {
59
+function _conferenceFailed(state, { error: { message, name } }) {
60
+    if (name === JitsiConferenceErrors.FOCUS_LEFT
61
+            || name === JitsiConferenceErrors.VIDEOBRIDGE_NOT_AVAILABLE) {
62
         return assign(state, {
62
         return assign(state, {
63
             haveToReload: true,
63
             haveToReload: true,
64
             isNetworkFailure: false,
64
             isNetworkFailure: false,
65
+
66
+            // FIXME There is no message associated with CONFERENCE_FAILED at
67
+            // the time of this writing. In jitsi-meet the action creator
68
+            // conferenceFailed neither accepts an argument message nor defines
69
+            // a property message on the error. In lib-jitsi-meet
70
+            // CONFERENCE_FAILED emissions mostly do not provide a message with
71
+            // the exception of at least one which provides an Error, not a
72
+            // string.
65
             reason: message
73
             reason: message
66
         });
74
         });
67
     }
75
     }

+ 2
- 1
react/features/room-lock/middleware.js Vedi File

27
     case CONFERENCE_FAILED: {
27
     case CONFERENCE_FAILED: {
28
         const { conference, error } = action;
28
         const { conference, error } = action;
29
 
29
 
30
-        if (conference && error === JitsiConferenceErrors.PASSWORD_REQUIRED) {
30
+        if (conference
31
+                && error.name === JitsiConferenceErrors.PASSWORD_REQUIRED) {
31
             store.dispatch(_openPasswordRequiredPrompt(conference));
32
             store.dispatch(_openPasswordRequiredPrompt(conference));
32
         }
33
         }
33
         break;
34
         break;

Loading…
Annulla
Salva