Преглед изворни кода

fix(notifications) Fix hiding audio/video lost notification

master
hmuresan пре 4 година
родитељ
комит
6f41ef75d7
1 измењених фајлова са 6 додато и 9 уклоњено
  1. 6
    9
      react/features/base/tracks/actions.js

+ 6
- 9
react/features/base/tracks/actions.js Прегледај датотеку

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

Loading…
Откажи
Сачувај