Browse Source

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

master
hmuresan 3 years ago
parent
commit
8b23265a50

+ 3
- 2
react/features/base/devices/middleware.js View File

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

+ 4
- 2
react/features/notifications/actions.js View File

105
  * Queues a warning notification for display.
105
  * Queues a warning notification for display.
106
  *
106
  *
107
  * @param {Object} props - The props needed to show the notification component.
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
  * @returns {Object}
110
  * @returns {Object}
109
  */
111
  */
110
-export function showWarningNotification(props: Object) {
112
+export function showWarningNotification(props: Object, timeout: ?number) {
111
     return showNotification({
113
     return showNotification({
112
         ...props,
114
         ...props,
113
         appearance: NOTIFICATION_TYPE.WARNING
115
         appearance: NOTIFICATION_TYPE.WARNING
114
-    });
116
+    }, timeout);
115
 }
117
 }
116
 
118
 
117
 /**
119
 /**

Loading…
Cancel
Save