Procházet zdrojové kódy

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

factor2
damencho před 11 měsíci
rodič
revize
d438292d2c

+ 1
- 0
lang/main.json Zobrazit soubor

@@ -739,6 +739,7 @@
739 739
         "connectedOneMember": "{{name}} joined the meeting",
740 740
         "connectedThreePlusMembers": "{{name}} and many others joined the meeting",
741 741
         "connectedTwoMembers": "{{first}} and {{second}} joined the meeting",
742
+        "connectionFailed": "Connection failed. Please try again later!",
742 743
         "dataChannelClosed": "Video quality may be impaired",
743 744
         "dataChannelClosedDescription": "The bridge channel is down and thus video quality may be limited to its lowest setting.",
744 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 Zobrazit soubor

@@ -16,8 +16,9 @@ import { IStore } from '../../app/types';
16 16
 import { removeLobbyChatParticipant } from '../../chat/actions.any';
17 17
 import { openDisplayNamePrompt } from '../../display-name/actions';
18 18
 import { isVpaasMeeting } from '../../jaas/functions';
19
-import { showErrorNotification } from '../../notifications/actions';
19
+import { showErrorNotification, showNotification } from '../../notifications/actions';
20 20
 import { NOTIFICATION_TIMEOUT_TYPE } from '../../notifications/constants';
21
+import { INotificationProps } from '../../notifications/types';
21 22
 import { hasDisplayName } from '../../prejoin/utils';
22 23
 import { stopLocalVideoRecording } from '../../recording/actions.any';
23 24
 import LocalRecordingManager from '../../recording/components/Recording/LocalRecordingManager';
@@ -419,6 +420,16 @@ function _connectionFailed({ dispatch, getState }: IStore, next: Function, actio
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 433
     const result = next(action);
423 434
 
424 435
     _removeUnloadHandler(getState);

+ 2
- 3
react/features/base/connection/actions.any.ts Zobrazit soubor

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

+ 1
- 2
react/features/base/lib-jitsi-meet/functions.any.ts Zobrazit soubor

@@ -97,8 +97,7 @@ export function isFatalJitsiConnectionError(error: Error | string | ConnectionFa
97 97
     }
98 98
 
99 99
     return (
100
-        error === JitsiConnectionErrors.CONFERENCE_REQUEST_FAILED
101
-            || error === JitsiConnectionErrors.CONNECTION_DROPPED_ERROR
100
+        error === JitsiConnectionErrors.CONNECTION_DROPPED_ERROR
102 101
             || error === JitsiConnectionErrors.OTHER_ERROR
103 102
             || error === JitsiConnectionErrors.SERVER_ERROR);
104 103
 }

Načítá se…
Zrušit
Uložit