Bladeren bron

feat(notifications): Make all error notifications sticky.

There are many cases where the error disappears and users easily miss the information.
factor2
damencho 4 maanden geleden
bovenliggende
commit
0387cdc888

+ 2
- 2
conference.js Bestand weergeven

@@ -287,7 +287,7 @@ class ConferenceConnector {
287 287
                 },
288 288
                 descriptionKey: 'dialog.reservationErrorMsg',
289 289
                 titleKey: 'dialog.reservationError'
290
-            }, NOTIFICATION_TIMEOUT_TYPE.LONG));
290
+            }));
291 291
             break;
292 292
         }
293 293
 
@@ -295,7 +295,7 @@ class ConferenceConnector {
295 295
             APP.store.dispatch(showErrorNotification({
296 296
                 descriptionKey: 'dialog.gracefulShutdown',
297 297
                 titleKey: 'dialog.serviceUnavailable'
298
-            }, NOTIFICATION_TIMEOUT_TYPE.LONG));
298
+            }));
299 299
             break;
300 300
 
301 301
         // FIXME FOCUS_DISCONNECTED is a confusing event name.

+ 5
- 5
react/features/base/conference/middleware.any.ts Bestand weergeven

@@ -177,7 +177,7 @@ function _conferenceFailed({ dispatch, getState }: IStore, next: Function, actio
177 177
             dispatch(showErrorNotification({
178 178
                 description: 'Restart initiated because of a bridge failure',
179 179
                 titleKey: 'dialog.sessionRestarted'
180
-            }, NOTIFICATION_TIMEOUT_TYPE.LONG));
180
+            }));
181 181
         }
182 182
 
183 183
         break;
@@ -190,7 +190,7 @@ function _conferenceFailed({ dispatch, getState }: IStore, next: Function, actio
190 190
             descriptionArguments: { msg },
191 191
             descriptionKey: msg ? 'dialog.connectErrorWithMsg' : 'dialog.connectError',
192 192
             titleKey: 'connection.CONNFAIL'
193
-        }, NOTIFICATION_TIMEOUT_TYPE.LONG));
193
+        }));
194 194
 
195 195
         break;
196 196
     }
@@ -199,7 +199,7 @@ function _conferenceFailed({ dispatch, getState }: IStore, next: Function, actio
199 199
             hideErrorSupportLink: true,
200 200
             descriptionKey: 'dialog.maxUsersLimitReached',
201 201
             titleKey: 'dialog.maxUsersLimitReachedTitle'
202
-        }, NOTIFICATION_TIMEOUT_TYPE.LONG));
202
+        }));
203 203
 
204 204
         // In case of max users(it can be from a visitor node), let's restore
205 205
         // oldConfig if any as we will be back to the main prosody.
@@ -236,7 +236,7 @@ function _conferenceFailed({ dispatch, getState }: IStore, next: Function, actio
236 236
             descriptionKey,
237 237
             hideErrorSupportLink: true,
238 238
             titleKey
239
-        }, NOTIFICATION_TIMEOUT_TYPE.STICKY));
239
+        }));
240 240
 
241 241
         sendAnalytics(createNotAllowedErrorEvent(type, msg));
242 242
 
@@ -416,7 +416,7 @@ function _connectionFailed({ dispatch, getState }: IStore, next: Function, actio
416 416
                 descriptionKey: errors ? 'dialog.tokenAuthFailedWithReasons' : 'dialog.tokenAuthFailed',
417 417
                 descriptionArguments: { reason: errors },
418 418
                 titleKey: 'dialog.tokenAuthFailedTitle'
419
-            }, NOTIFICATION_TIMEOUT_TYPE.STICKY));
419
+            }));
420 420
         }
421 421
     }
422 422
 

+ 1
- 1
react/features/base/tracks/actions.any.ts Bestand weergeven

@@ -291,7 +291,7 @@ export function showNoDataFromSourceVideoError(jitsiTrack: any) {
291 291
             const notificationAction = dispatch(showErrorNotification({
292 292
                 descriptionKey: 'dialog.cameraNotSendingData',
293 293
                 titleKey: 'dialog.cameraNotSendingDataTitle'
294
-            }, NOTIFICATION_TIMEOUT_TYPE.LONG));
294
+            }));
295 295
 
296 296
             notificationInfo = {
297 297
                 uid: notificationAction?.uid

+ 5
- 7
react/features/base/tracks/actions.web.ts Bestand weergeven

@@ -157,7 +157,7 @@ async function _toggleScreenSharing(
157 157
             try {
158 158
                 tracks = await createLocalTracksF(options) as any[];
159 159
             } catch (error) {
160
-                dispatch(handleScreenSharingError(error, NOTIFICATION_TIMEOUT_TYPE.MEDIUM));
160
+                dispatch(handleScreenSharingError(error));
161 161
 
162 162
                 throw error;
163 163
             }
@@ -171,7 +171,7 @@ async function _toggleScreenSharing(
171 171
             desktopVideoTrack.dispose();
172 172
 
173 173
             if (!desktopAudioTrack) {
174
-                dispatch(handleScreenSharingError(AUDIO_ONLY_SCREEN_SHARE_NO_TRACK, NOTIFICATION_TIMEOUT_TYPE.MEDIUM));
174
+                dispatch(handleScreenSharingError(AUDIO_ONLY_SCREEN_SHARE_NO_TRACK));
175 175
 
176 176
                 throw new Error(AUDIO_ONLY_SCREEN_SHARE_NO_TRACK);
177 177
             }
@@ -457,7 +457,7 @@ export function displayErrorsForCreateInitialLocalTracks(errors: IInitialTracksE
457 457
         } = errors;
458 458
 
459 459
         if (screenSharingError) {
460
-            dispatch(handleScreenSharingError(screenSharingError, NOTIFICATION_TIMEOUT_TYPE.LONG));
460
+            dispatch(handleScreenSharingError(screenSharingError));
461 461
         }
462 462
         if (audioOnlyError || videoOnlyError) {
463 463
             if (audioOnlyError) {
@@ -476,12 +476,10 @@ export function displayErrorsForCreateInitialLocalTracks(errors: IInitialTracksE
476 476
  *
477 477
  * @private
478 478
  * @param {Error | AUDIO_ONLY_SCREEN_SHARE_NO_TRACK} error - The error.
479
- * @param {NOTIFICATION_TIMEOUT_TYPE} timeout - The time for showing the notification.
480 479
  * @returns {Function}
481 480
  */
482 481
 export function handleScreenSharingError(
483
-        error: Error | AUDIO_ONLY_SCREEN_SHARE_NO_TRACK,
484
-        timeout: NOTIFICATION_TIMEOUT_TYPE) {
482
+        error: Error | AUDIO_ONLY_SCREEN_SHARE_NO_TRACK) {
485 483
     return (dispatch: IStore['dispatch']) => {
486 484
         logger.error('failed to share local desktop', error);
487 485
 
@@ -508,6 +506,6 @@ export function handleScreenSharingError(
508 506
         dispatch(showErrorNotification({
509 507
             descriptionKey,
510 508
             titleKey
511
-        }, timeout));
509
+        }));
512 510
     };
513 511
 }

+ 1
- 1
react/features/invite/components/add-people-dialog/AbstractAddPeopleDialog.tsx Bestand weergeven

@@ -190,7 +190,7 @@ export default class AbstractAddPeopleDialog<P extends IProps, S extends IState>
190 190
                         }));
191 191
                     dispatch(showErrorNotification({
192 192
                         titleKey: 'addPeople.failedToAdd'
193
-                    }, NOTIFICATION_TIMEOUT_TYPE.MEDIUM));
193
+                    }));
194 194
                 } else if (!_callFlowsEnabled) {
195 195
                     const invitedCount = invitees.length;
196 196
                     let notificationProps: INotificationProps | undefined;

+ 1
- 2
react/features/noise-suppression/actions.ts Bestand weergeven

@@ -1,7 +1,6 @@
1 1
 import { IStore } from '../app/types';
2 2
 import { getLocalJitsiAudioTrack } from '../base/tracks/functions';
3 3
 import { showErrorNotification } from '../notifications/actions';
4
-import { NOTIFICATION_TIMEOUT_TYPE } from '../notifications/constants';
5 4
 import { NoiseSuppressionEffect } from '../stream-effects/noise-suppression/NoiseSuppressionEffect';
6 5
 
7 6
 import { SET_NOISE_SUPPRESSION_ENABLED } from './actionTypes';
@@ -93,7 +92,7 @@ export function setNoiseSuppressionEnabled(enabled: boolean): any {
93 92
 
94 93
             dispatch(showErrorNotification({
95 94
                 titleKey: 'notify.noiseSuppressionFailedTitle'
96
-            }, NOTIFICATION_TIMEOUT_TYPE.MEDIUM));
95
+            }));
97 96
         }
98 97
     };
99 98
 }

+ 1
- 1
react/features/notifications/actions.ts Bestand weergeven

@@ -97,7 +97,7 @@ export function setNotificationsEnabled(enabled: boolean) {
97 97
  * @param {string} type - Notification type.
98 98
  * @returns {Object}
99 99
  */
100
-export function showErrorNotification(props: INotificationProps, type?: string) {
100
+export function showErrorNotification(props: INotificationProps, type = NOTIFICATION_TIMEOUT_TYPE.STICKY) {
101 101
     return showNotification({
102 102
         ...props,
103 103
         appearance: NOTIFICATION_TYPE.ERROR

+ 1
- 2
react/features/old-client-notification/middleware.tsx Bestand weergeven

@@ -5,7 +5,6 @@ import { IStore } from '../app/types';
5 5
 import { APP_WILL_MOUNT } from '../base/app/actionTypes';
6 6
 import MiddlewareRegistry from '../base/redux/MiddlewareRegistry';
7 7
 import { showErrorNotification } from '../notifications/actions';
8
-import { NOTIFICATION_TIMEOUT_TYPE } from '../notifications/constants';
9 8
 
10 9
 import OldElectronAPPNotificationDescription from './components/OldElectronAPPNotificationDescription';
11 10
 import { isOldJitsiMeetElectronApp } from './functions';
@@ -35,7 +34,7 @@ function _appWillMount(store: IStore, next: Function, action: AnyAction) {
35 34
         dispatch(showErrorNotification({
36 35
             titleKey: 'notify.OldElectronAPPTitle',
37 36
             description: <OldElectronAPPNotificationDescription />
38
-        }, NOTIFICATION_TIMEOUT_TYPE.LONG));
37
+        }));
39 38
     }
40 39
 
41 40
     return next(action);

+ 4
- 5
react/features/prejoin/actions.web.ts Bestand weergeven

@@ -16,7 +16,6 @@ import {
16 16
 import { openURLInBrowser } from '../base/util/openURLInBrowser';
17 17
 import { executeDialOutRequest, executeDialOutStatusRequest, getDialInfoPageURL } from '../invite/functions';
18 18
 import { showErrorNotification } from '../notifications/actions';
19
-import { NOTIFICATION_TIMEOUT_TYPE } from '../notifications/constants';
20 19
 import { INotificationProps } from '../notifications/types';
21 20
 
22 21
 import {
@@ -108,7 +107,7 @@ function pollForStatus(
108 107
             case DIAL_OUT_STATUS.DISCONNECTED: {
109 108
                 dispatch(showErrorNotification({
110 109
                     titleKey: 'prejoin.errorDialOutDisconnected'
111
-                }, NOTIFICATION_TIMEOUT_TYPE.LONG));
110
+                }));
112 111
 
113 112
                 return onFail();
114 113
             }
@@ -116,7 +115,7 @@ function pollForStatus(
116 115
             case DIAL_OUT_STATUS.FAILED: {
117 116
                 dispatch(showErrorNotification({
118 117
                     titleKey: 'prejoin.errorDialOutFailed'
119
-                }, NOTIFICATION_TIMEOUT_TYPE.LONG));
118
+                }));
120 119
 
121 120
                 return onFail();
122 121
             }
@@ -124,7 +123,7 @@ function pollForStatus(
124 123
         } catch (err) {
125 124
             dispatch(showErrorNotification({
126 125
                 titleKey: 'prejoin.errorDialOutStatus'
127
-            }, NOTIFICATION_TIMEOUT_TYPE.LONG));
126
+            }));
128 127
             logger.error('Error getting dial out status', err);
129 128
             onFail();
130 129
         }
@@ -177,7 +176,7 @@ export function dialOut(onSuccess: Function, onFail: Function) {
177 176
                 }
178 177
             }
179 178
 
180
-            dispatch(showErrorNotification(notification, NOTIFICATION_TIMEOUT_TYPE.LONG));
179
+            dispatch(showErrorNotification(notification));
181 180
             logger.error('Error dialing out', err);
182 181
             onFail();
183 182
         }

+ 2
- 2
react/features/recording/actions.any.ts Bestand weergeven

@@ -189,7 +189,7 @@ export function highlightMeetingMoment() {
189 189
  * @returns {showErrorNotification}
190 190
  */
191 191
 export function showRecordingError(props: Object) {
192
-    return showErrorNotification(props, NOTIFICATION_TIMEOUT_TYPE.LONG);
192
+    return showErrorNotification(props);
193 193
 }
194 194
 
195 195
 /**
@@ -301,7 +301,7 @@ export function showStartedRecordingNotification(
301 301
                 } catch (err) {
302 302
                     dispatch(showErrorNotification({
303 303
                         titleKey: 'recording.errorFetchingLink'
304
-                    }, NOTIFICATION_TIMEOUT_TYPE.MEDIUM));
304
+                    }));
305 305
 
306 306
                     return logger.error('Could not fetch recording link', err);
307 307
                 }

+ 1
- 2
react/features/recording/components/Recording/AbstractStartRecordingDialog.ts Bestand weergeven

@@ -9,7 +9,6 @@ import { JitsiRecordingConstants } from '../../../base/lib-jitsi-meet';
9 9
 import { updateDropboxToken } from '../../../dropbox/actions';
10 10
 import { getDropboxData, getNewAccessToken, isEnabled as isDropboxEnabled } from '../../../dropbox/functions.any';
11 11
 import { showErrorNotification } from '../../../notifications/actions';
12
-import { NOTIFICATION_TIMEOUT_TYPE } from '../../../notifications/constants';
13 12
 import { setRequestingSubtitles } from '../../../subtitles/actions.any';
14 13
 import { setSelectedRecordingService, startLocalVideoRecording } from '../../actions';
15 14
 import { RECORDING_METADATA_ID, RECORDING_TYPES } from '../../constants';
@@ -381,7 +380,7 @@ class AbstractStartRecordingDialog extends Component<IProps, IState> {
381 380
                 } else {
382 381
                     dispatch(showErrorNotification({
383 382
                         titleKey: 'dialog.noDropboxToken'
384
-                    }, NOTIFICATION_TIMEOUT_TYPE.LONG));
383
+                    }));
385 384
 
386 385
                     return;
387 386
                 }

+ 1
- 1
react/features/recording/middleware.ts Bestand weergeven

@@ -162,7 +162,7 @@ MiddlewareRegistry.register(({ dispatch, getState }) => next => action => {
162 162
                     false, 'local', err.message, isRecorderTranscriptionsRunning(getState()));
163 163
             }
164 164
 
165
-            dispatch(showErrorNotification(props, NOTIFICATION_TIMEOUT_TYPE.MEDIUM));
165
+            dispatch(showErrorNotification(props));
166 166
         });
167 167
         break;
168 168
     }

+ 1
- 1
react/features/room-lock/middleware.ts Bestand weergeven

@@ -142,7 +142,7 @@ function _setPasswordFailed(store: IStore, next: Function, action: AnyAction) {
142 142
         APP.store.dispatch(showErrorNotification({
143 143
             descriptionKey,
144 144
             titleKey
145
-        }, NOTIFICATION_TIMEOUT_TYPE.LONG));
145
+        }));
146 146
     }
147 147
 
148 148
     return next(action);

+ 1
- 2
react/features/transcribing/middleware.ts Bestand weergeven

@@ -1,6 +1,5 @@
1 1
 import MiddlewareRegistry from '../base/redux/MiddlewareRegistry';
2 2
 import { showErrorNotification } from '../notifications/actions';
3
-import { NOTIFICATION_TIMEOUT_TYPE } from '../notifications/constants';
4 3
 
5 4
 import { TRANSCRIBER_LEFT } from './actionTypes';
6 5
 import './subscriber';
@@ -17,7 +16,7 @@ MiddlewareRegistry.register(({ dispatch }) => next => action => {
17 16
         if (action.abruptly) {
18 17
             dispatch(showErrorNotification({
19 18
                 titleKey: 'transcribing.failed'
20
-            }, NOTIFICATION_TIMEOUT_TYPE.LONG));
19
+            }));
21 20
         }
22 21
         break;
23 22
     }

+ 3
- 3
react/features/videosipgw/middleware.ts Bestand weergeven

@@ -105,7 +105,7 @@ function _inviteRooms(rooms: ISipRoom[], conference: IJitsiConference, dispatch:
105 105
                     dispatch(showErrorNotification({
106 106
                         descriptionKey: 'videoSIPGW.errorInvite',
107 107
                         titleKey: 'videoSIPGW.errorInviteTitle'
108
-                    }, NOTIFICATION_TIMEOUT_TYPE.LONG));
108
+                    }));
109 109
 
110 110
                     return;
111 111
                 }
@@ -159,14 +159,14 @@ function _sessionStateChanged(
159 159
                 displayName: event.displayName
160 160
             },
161 161
             descriptionKey: 'videoSIPGW.errorInviteFailed'
162
-        }, NOTIFICATION_TIMEOUT_TYPE.LONG);
162
+        });
163 163
     }
164 164
     case JitsiSIPVideoGWStatus.STATE_OFF: {
165 165
         if (event.failureReason === JitsiSIPVideoGWStatus.STATUS_BUSY) {
166 166
             return showErrorNotification({
167 167
                 descriptionKey: 'videoSIPGW.busy',
168 168
                 titleKey: 'videoSIPGW.busyTitle'
169
-            }, NOTIFICATION_TIMEOUT_TYPE.LONG);
169
+            });
170 170
         } else if (event.failureReason) {
171 171
             logger.error(`Unknown sip videogw error ${event.newState} ${
172 172
                 event.failureReason}`);

Laden…
Annuleren
Opslaan