Browse Source

fix(notifications) Fix hiding audio/video lost notification

master
hmuresan 4 years ago
parent
commit
6f41ef75d7
1 changed files with 6 additions and 9 deletions
  1. 6
    9
      react/features/base/tracks/actions.js

+ 6
- 9
react/features/base/tracks/actions.js View File

227
  * @returns {Function}
227
  * @returns {Function}
228
  */
228
  */
229
 export function showNoDataFromSourceVideoError(jitsiTrack) {
229
 export function showNoDataFromSourceVideoError(jitsiTrack) {
230
-    return (dispatch, getState) => {
230
+    return async (dispatch, getState) => {
231
         let notificationInfo;
231
         let notificationInfo;
232
 
232
 
233
         const track = getTrackByJitsiTrack(getState()['features/base/tracks'], jitsiTrack);
233
         const track = getTrackByJitsiTrack(getState()['features/base/tracks'], jitsiTrack);
239
         if (track.isReceivingData) {
239
         if (track.isReceivingData) {
240
             notificationInfo = undefined;
240
             notificationInfo = undefined;
241
         } else {
241
         } else {
242
-            const notificationAction = showErrorNotification({
242
+            const notificationAction = await dispatch(showErrorNotification({
243
                 descriptionKey: 'dialog.cameraNotSendingData',
243
                 descriptionKey: 'dialog.cameraNotSendingData',
244
                 titleKey: 'dialog.cameraNotSendingDataTitle'
244
                 titleKey: 'dialog.cameraNotSendingDataTitle'
245
-            });
245
+            }));
246
 
246
 
247
-            dispatch(notificationAction);
248
             notificationInfo = {
247
             notificationInfo = {
249
                 uid: notificationAction.uid
248
                 uid: notificationAction.uid
250
             };
249
             };
362
  * @returns {{ type: TRACK_ADDED, track: Track }}
361
  * @returns {{ type: TRACK_ADDED, track: Track }}
363
  */
362
  */
364
 export function trackAdded(track) {
363
 export function trackAdded(track) {
365
-    return (dispatch, getState) => {
364
+    return async (dispatch, getState) => {
366
         track.on(
365
         track.on(
367
             JitsiTrackEvents.TRACK_MUTE_CHANGED,
366
             JitsiTrackEvents.TRACK_MUTE_CHANGED,
368
             () => dispatch(trackMutedChanged(track)));
367
             () => dispatch(trackMutedChanged(track)));
389
             track.on(JitsiTrackEvents.NO_DATA_FROM_SOURCE, () => dispatch(noDataFromSource({ jitsiTrack: track })));
388
             track.on(JitsiTrackEvents.NO_DATA_FROM_SOURCE, () => dispatch(noDataFromSource({ jitsiTrack: track })));
390
             if (!isReceivingData) {
389
             if (!isReceivingData) {
391
                 if (mediaType === MEDIA_TYPE.AUDIO) {
390
                 if (mediaType === MEDIA_TYPE.AUDIO) {
392
-                    const notificationAction = showNotification({
391
+                    const notificationAction = await dispatch(showNotification({
393
                         descriptionKey: 'dialog.micNotSendingData',
392
                         descriptionKey: 'dialog.micNotSendingData',
394
                         titleKey: 'dialog.micNotSendingDataTitle'
393
                         titleKey: 'dialog.micNotSendingDataTitle'
395
-                    });
396
-
397
-                    dispatch(notificationAction);
394
+                    }));
398
 
395
 
399
                     // Set the notification ID so that other parts of the application know that this was
396
                     // Set the notification ID so that other parts of the application know that this was
400
                     // displayed in the context of the current device.
397
                     // displayed in the context of the current device.

Loading…
Cancel
Save