Browse Source

fix(connection): Shows notification instead of reload on conference request failed.

factor2
damencho 11 months ago
parent
commit
d438292d2c

+ 1
- 0
lang/main.json View File

739
         "connectedOneMember": "{{name}} joined the meeting",
739
         "connectedOneMember": "{{name}} joined the meeting",
740
         "connectedThreePlusMembers": "{{name}} and many others joined the meeting",
740
         "connectedThreePlusMembers": "{{name}} and many others joined the meeting",
741
         "connectedTwoMembers": "{{first}} and {{second}} joined the meeting",
741
         "connectedTwoMembers": "{{first}} and {{second}} joined the meeting",
742
+        "connectionFailed": "Connection failed. Please try again later!",
742
         "dataChannelClosed": "Video quality may be impaired",
743
         "dataChannelClosed": "Video quality may be impaired",
743
         "dataChannelClosedDescription": "The bridge channel is down and thus video quality may be limited to its lowest setting.",
744
         "dataChannelClosedDescription": "The bridge channel is down and thus video quality may be limited to its lowest setting.",
744
         "dataChannelClosedDescriptionWithAudio": "The bridge channel is down and thus disruptions to audio and video may occur.",
745
         "dataChannelClosedDescriptionWithAudio": "The bridge channel is down and thus disruptions to audio and video may occur.",

+ 12
- 1
react/features/base/conference/middleware.any.ts View File

16
 import { removeLobbyChatParticipant } from '../../chat/actions.any';
16
 import { removeLobbyChatParticipant } from '../../chat/actions.any';
17
 import { openDisplayNamePrompt } from '../../display-name/actions';
17
 import { openDisplayNamePrompt } from '../../display-name/actions';
18
 import { isVpaasMeeting } from '../../jaas/functions';
18
 import { isVpaasMeeting } from '../../jaas/functions';
19
-import { showErrorNotification } from '../../notifications/actions';
19
+import { showErrorNotification, showNotification } from '../../notifications/actions';
20
 import { NOTIFICATION_TIMEOUT_TYPE } from '../../notifications/constants';
20
 import { NOTIFICATION_TIMEOUT_TYPE } from '../../notifications/constants';
21
+import { INotificationProps } from '../../notifications/types';
21
 import { hasDisplayName } from '../../prejoin/utils';
22
 import { hasDisplayName } from '../../prejoin/utils';
22
 import { stopLocalVideoRecording } from '../../recording/actions.any';
23
 import { stopLocalVideoRecording } from '../../recording/actions.any';
23
 import LocalRecordingManager from '../../recording/components/Recording/LocalRecordingManager';
24
 import LocalRecordingManager from '../../recording/components/Recording/LocalRecordingManager';
419
         }
420
         }
420
     }
421
     }
421
 
422
 
423
+    if (error.name === JitsiConnectionErrors.CONFERENCE_REQUEST_FAILED) {
424
+        const notificationProps = {
425
+            customActionNameKey: [ 'dialog.rejoinNow' ],
426
+            customActionHandler: [ () => dispatch(reloadNow()) ],
427
+            descriptionKey: 'notify.connectionFailed'
428
+        } as INotificationProps;
429
+
430
+        dispatch(showNotification(notificationProps, NOTIFICATION_TIMEOUT_TYPE.STICKY));
431
+    }
432
+
422
     const result = next(action);
433
     const result = next(action);
423
 
434
 
424
     _removeUnloadHandler(getState);
435
     _removeUnloadHandler(getState);

+ 2
- 3
react/features/base/connection/actions.any.ts View File

4
 import { conferenceLeft, conferenceWillLeave, redirect } from '../conference/actions';
4
 import { conferenceLeft, conferenceWillLeave, redirect } from '../conference/actions';
5
 import { getCurrentConference } from '../conference/functions';
5
 import { getCurrentConference } from '../conference/functions';
6
 import { IConfigState } from '../config/reducer';
6
 import { IConfigState } from '../config/reducer';
7
-import JitsiMeetJS, { JitsiConnectionErrors, JitsiConnectionEvents } from '../lib-jitsi-meet';
7
+import JitsiMeetJS, { JitsiConnectionEvents } from '../lib-jitsi-meet';
8
 import { parseURLParams } from '../util/parseURLParams';
8
 import { parseURLParams } from '../util/parseURLParams';
9
 import {
9
 import {
10
     appendURLParam,
10
     appendURLParam,
288
                     credentials,
288
                     credentials,
289
                     details,
289
                     details,
290
                     name: err,
290
                     name: err,
291
-                    message,
292
-                    recoverable: err === JitsiConnectionErrors.CONFERENCE_REQUEST_FAILED ? false : undefined
291
+                    message
293
                 }));
292
                 }));
294
 
293
 
295
                 reject(err);
294
                 reject(err);

+ 1
- 2
react/features/base/lib-jitsi-meet/functions.any.ts View File

97
     }
97
     }
98
 
98
 
99
     return (
99
     return (
100
-        error === JitsiConnectionErrors.CONFERENCE_REQUEST_FAILED
101
-            || error === JitsiConnectionErrors.CONNECTION_DROPPED_ERROR
100
+        error === JitsiConnectionErrors.CONNECTION_DROPPED_ERROR
102
             || error === JitsiConnectionErrors.OTHER_ERROR
101
             || error === JitsiConnectionErrors.OTHER_ERROR
103
             || error === JitsiConnectionErrors.SERVER_ERROR);
102
             || error === JitsiConnectionErrors.SERVER_ERROR);
104
 }
103
 }

Loading…
Cancel
Save