Переглянути джерело

fix(notifications) Add timeout for video/audio lost notifs

master
hmuresan 3 роки тому
джерело
коміт
8b23265a50

+ 3
- 2
react/features/base/devices/middleware.js Переглянути файл

@@ -50,6 +50,7 @@ const JITSI_TRACK_ERROR_TO_MESSAGE_KEY_MAP = {
50 50
     }
51 51
 };
52 52
 
53
+const WARNING_DISPLAY_TIMER = 4000;
53 54
 
54 55
 /**
55 56
  * A listener for device permissions changed reported from lib-jitsi-meet.
@@ -133,7 +134,7 @@ MiddlewareRegistry.register(store => next => action => {
133 134
             description: additionalCameraErrorMsg,
134 135
             descriptionKey: cameraErrorMsg,
135 136
             titleKey
136
-        }));
137
+        }, WARNING_DISPLAY_TIMER));
137 138
 
138 139
         if (isPrejoinPageVisible(store.getState())) {
139 140
             store.dispatch(setDeviceStatusWarning(titleKey));
@@ -162,7 +163,7 @@ MiddlewareRegistry.register(store => next => action => {
162 163
             description: additionalMicErrorMsg,
163 164
             descriptionKey: micErrorMsg,
164 165
             titleKey
165
-        }));
166
+        }, WARNING_DISPLAY_TIMER));
166 167
 
167 168
         if (isPrejoinPageVisible(store.getState())) {
168 169
             store.dispatch(setDeviceStatusWarning(titleKey));

+ 4
- 2
react/features/notifications/actions.js Переглянути файл

@@ -105,13 +105,15 @@ export function showNotification(props: Object = {}, timeout: ?number) {
105 105
  * Queues a warning notification for display.
106 106
  *
107 107
  * @param {Object} props - The props needed to show the notification component.
108
+ * @param {number} timeout - How long the notification should display before
109
+ * automatically being hidden.
108 110
  * @returns {Object}
109 111
  */
110
-export function showWarningNotification(props: Object) {
112
+export function showWarningNotification(props: Object, timeout: ?number) {
111 113
     return showNotification({
112 114
         ...props,
113 115
         appearance: NOTIFICATION_TYPE.WARNING
114
-    });
116
+    }, timeout);
115 117
 }
116 118
 
117 119
 /**

Завантаження…
Відмінити
Зберегти