Extract notification timeout to a constant
This commit is contained in:
parent
4e78502c9e
commit
5d9762b429
|
@ -4,6 +4,7 @@ const logger = require('jitsi-meet-logger').getLogger(__filename);
|
|||
import jitsiLocalStorage from '../../util/JitsiLocalStorage';
|
||||
|
||||
import {
|
||||
NOTIFICATION_TIMEOUT,
|
||||
showErrorNotification,
|
||||
showNotification,
|
||||
showWarningNotification
|
||||
|
@ -454,7 +455,7 @@ const messageHandler = {
|
|||
cls,
|
||||
messageKey,
|
||||
messageArguments,
|
||||
timeout = 2500) {
|
||||
timeout = NOTIFICATION_TIMEOUT) {
|
||||
APP.store.dispatch(showNotification({
|
||||
descriptionArguments: messageArguments,
|
||||
descriptionKey: messageKey,
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
import throttle from 'lodash/throttle';
|
||||
|
||||
import { set } from '../redux';
|
||||
import { showNotification } from '../../notifications';
|
||||
import { NOTIFICATION_TIMEOUT, showNotification } from '../../notifications';
|
||||
|
||||
import {
|
||||
DOMINANT_SPEAKER_CHANGED,
|
||||
|
@ -452,7 +452,7 @@ const _throttledNotifyParticipantConnected = throttle(dispatch => {
|
|||
|
||||
if (notificationProps) {
|
||||
dispatch(
|
||||
showNotification(notificationProps, 2500));
|
||||
showNotification(notificationProps, NOTIFICATION_TIMEOUT));
|
||||
}
|
||||
|
||||
joinedParticipantsNames = [];
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
import UIEvents from '../../../../service/UI/UIEvents';
|
||||
|
||||
import { showNotification } from '../../notifications';
|
||||
import { NOTIFICATION_TIMEOUT, showNotification } from '../../notifications';
|
||||
import { CALLING, INVITED } from '../../presence-status';
|
||||
|
||||
import { APP_WILL_MOUNT, APP_WILL_UNMOUNT } from '../app';
|
||||
|
@ -395,7 +395,7 @@ function _raiseHandUpdated({ dispatch, getState }, conference, participant, newV
|
|||
name: getParticipantDisplayName(getState, participant.getId())
|
||||
},
|
||||
titleKey: 'notify.raisedHand'
|
||||
}, 2500));
|
||||
}, NOTIFICATION_TIMEOUT));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,10 @@
|
|||
// @flow
|
||||
|
||||
/**
|
||||
* The standard time when auto-disappearing notifications should disappear.
|
||||
*/
|
||||
export const NOTIFICATION_TIMEOUT = 2500;
|
||||
|
||||
/**
|
||||
* The set of possible notification types.
|
||||
*
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
export * from './actions';
|
||||
export * from './actionTypes';
|
||||
export * from './components';
|
||||
export * from './constants';
|
||||
export * from './functions';
|
||||
|
||||
import './middleware';
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
import JitsiMeetJS, { JitsiRecordingConstants } from '../base/lib-jitsi-meet';
|
||||
import {
|
||||
NOTIFICATION_TIMEOUT,
|
||||
hideNotification,
|
||||
showErrorNotification,
|
||||
showNotification
|
||||
|
@ -125,7 +126,7 @@ export function showStoppedRecordingNotification(streamType: string) {
|
|||
titleKey: 'dialog.recording'
|
||||
};
|
||||
|
||||
return showNotification(dialogProps, 2500);
|
||||
return showNotification(dialogProps, NOTIFICATION_TIMEOUT);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -10,6 +10,7 @@ import {
|
|||
STOP_TRANSCRIBING
|
||||
} from './actionTypes';
|
||||
import {
|
||||
NOTIFICATION_TIMEOUT,
|
||||
hideNotification,
|
||||
showErrorNotification,
|
||||
showNotification
|
||||
|
@ -161,7 +162,7 @@ export function hidePendingTranscribingNotification() {
|
|||
|
||||
/**
|
||||
* Signals that the stopped transcribing notification should be shown on the
|
||||
* screen for a 2500 ms.
|
||||
* screen.
|
||||
*
|
||||
* @returns {showNotification}
|
||||
*/
|
||||
|
@ -169,7 +170,7 @@ export function showStoppedTranscribingNotification() {
|
|||
return showNotification({
|
||||
descriptionKey: 'transcribing.off',
|
||||
titleKey: 'dialog.transcribing'
|
||||
}, 2500);
|
||||
}, NOTIFICATION_TIMEOUT);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue