fix(notifications) Add timeout for video/audio lost notifs
This commit is contained in:
parent
5bc424459f
commit
8b23265a50
|
@ -50,6 +50,7 @@ const JITSI_TRACK_ERROR_TO_MESSAGE_KEY_MAP = {
|
|||
}
|
||||
};
|
||||
|
||||
const WARNING_DISPLAY_TIMER = 4000;
|
||||
|
||||
/**
|
||||
* A listener for device permissions changed reported from lib-jitsi-meet.
|
||||
|
@ -133,7 +134,7 @@ MiddlewareRegistry.register(store => next => action => {
|
|||
description: additionalCameraErrorMsg,
|
||||
descriptionKey: cameraErrorMsg,
|
||||
titleKey
|
||||
}));
|
||||
}, WARNING_DISPLAY_TIMER));
|
||||
|
||||
if (isPrejoinPageVisible(store.getState())) {
|
||||
store.dispatch(setDeviceStatusWarning(titleKey));
|
||||
|
@ -162,7 +163,7 @@ MiddlewareRegistry.register(store => next => action => {
|
|||
description: additionalMicErrorMsg,
|
||||
descriptionKey: micErrorMsg,
|
||||
titleKey
|
||||
}));
|
||||
}, WARNING_DISPLAY_TIMER));
|
||||
|
||||
if (isPrejoinPageVisible(store.getState())) {
|
||||
store.dispatch(setDeviceStatusWarning(titleKey));
|
||||
|
|
|
@ -105,13 +105,15 @@ export function showNotification(props: Object = {}, timeout: ?number) {
|
|||
* Queues a warning notification for display.
|
||||
*
|
||||
* @param {Object} props - The props needed to show the notification component.
|
||||
* @param {number} timeout - How long the notification should display before
|
||||
* automatically being hidden.
|
||||
* @returns {Object}
|
||||
*/
|
||||
export function showWarningNotification(props: Object) {
|
||||
export function showWarningNotification(props: Object, timeout: ?number) {
|
||||
return showNotification({
|
||||
...props,
|
||||
appearance: NOTIFICATION_TYPE.WARNING
|
||||
});
|
||||
}, timeout);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue