Просмотр исходного кода

Extract notification timeout to a constant

j8
Bettenbuk Zoltan 6 лет назад
Родитель
Сommit
5d9762b429

+ 2
- 1
modules/UI/util/MessageHandler.js Просмотреть файл

@@ -4,6 +4,7 @@ const logger = require('jitsi-meet-logger').getLogger(__filename);
4 4
 import jitsiLocalStorage from '../../util/JitsiLocalStorage';
5 5
 
6 6
 import {
7
+    NOTIFICATION_TIMEOUT,
7 8
     showErrorNotification,
8 9
     showNotification,
9 10
     showWarningNotification
@@ -454,7 +455,7 @@ const messageHandler = {
454 455
             cls,
455 456
             messageKey,
456 457
             messageArguments,
457
-            timeout = 2500) {
458
+            timeout = NOTIFICATION_TIMEOUT) {
458 459
         APP.store.dispatch(showNotification({
459 460
             descriptionArguments: messageArguments,
460 461
             descriptionKey: messageKey,

+ 2
- 2
react/features/base/participants/actions.js Просмотреть файл

@@ -3,7 +3,7 @@
3 3
 import throttle from 'lodash/throttle';
4 4
 
5 5
 import { set } from '../redux';
6
-import { showNotification } from '../../notifications';
6
+import { NOTIFICATION_TIMEOUT, showNotification } from '../../notifications';
7 7
 
8 8
 import {
9 9
     DOMINANT_SPEAKER_CHANGED,
@@ -452,7 +452,7 @@ const _throttledNotifyParticipantConnected = throttle(dispatch => {
452 452
 
453 453
     if (notificationProps) {
454 454
         dispatch(
455
-            showNotification(notificationProps, 2500));
455
+            showNotification(notificationProps, NOTIFICATION_TIMEOUT));
456 456
     }
457 457
 
458 458
     joinedParticipantsNames = [];

+ 2
- 2
react/features/base/participants/middleware.js Просмотреть файл

@@ -2,7 +2,7 @@
2 2
 
3 3
 import UIEvents from '../../../../service/UI/UIEvents';
4 4
 
5
-import { showNotification } from '../../notifications';
5
+import { NOTIFICATION_TIMEOUT, showNotification } from '../../notifications';
6 6
 import { CALLING, INVITED } from '../../presence-status';
7 7
 
8 8
 import { APP_WILL_MOUNT, APP_WILL_UNMOUNT } from '../app';
@@ -395,7 +395,7 @@ function _raiseHandUpdated({ dispatch, getState }, conference, participant, newV
395 395
                 name: getParticipantDisplayName(getState, participant.getId())
396 396
             },
397 397
             titleKey: 'notify.raisedHand'
398
-        }, 2500));
398
+        }, NOTIFICATION_TIMEOUT));
399 399
     }
400 400
 }
401 401
 

+ 5
- 0
react/features/notifications/constants.js Просмотреть файл

@@ -1,5 +1,10 @@
1 1
 // @flow
2 2
 
3
+/**
4
+ * The standard time when auto-disappearing notifications should disappear.
5
+ */
6
+export const NOTIFICATION_TIMEOUT = 2500;
7
+
3 8
 /**
4 9
  * The set of possible notification types.
5 10
  *

+ 1
- 0
react/features/notifications/index.js Просмотреть файл

@@ -3,6 +3,7 @@
3 3
 export * from './actions';
4 4
 export * from './actionTypes';
5 5
 export * from './components';
6
+export * from './constants';
6 7
 export * from './functions';
7 8
 
8 9
 import './middleware';

+ 2
- 1
react/features/recording/actions.js Просмотреть файл

@@ -2,6 +2,7 @@
2 2
 
3 3
 import JitsiMeetJS, { JitsiRecordingConstants } from '../base/lib-jitsi-meet';
4 4
 import {
5
+    NOTIFICATION_TIMEOUT,
5 6
     hideNotification,
6 7
     showErrorNotification,
7 8
     showNotification
@@ -125,7 +126,7 @@ export function showStoppedRecordingNotification(streamType: string) {
125 126
         titleKey: 'dialog.recording'
126 127
     };
127 128
 
128
-    return showNotification(dialogProps, 2500);
129
+    return showNotification(dialogProps, NOTIFICATION_TIMEOUT);
129 130
 }
130 131
 
131 132
 /**

+ 3
- 2
react/features/transcribing/actions.js Просмотреть файл

@@ -10,6 +10,7 @@ import {
10 10
     STOP_TRANSCRIBING
11 11
 } from './actionTypes';
12 12
 import {
13
+    NOTIFICATION_TIMEOUT,
13 14
     hideNotification,
14 15
     showErrorNotification,
15 16
     showNotification
@@ -161,7 +162,7 @@ export function hidePendingTranscribingNotification() {
161 162
 
162 163
 /**
163 164
  * Signals that the stopped transcribing notification should be shown on the
164
- * screen for a 2500 ms.
165
+ * screen.
165 166
  *
166 167
  * @returns {showNotification}
167 168
  */
@@ -169,7 +170,7 @@ export function showStoppedTranscribingNotification() {
169 170
     return showNotification({
170 171
         descriptionKey: 'transcribing.off',
171 172
         titleKey: 'dialog.transcribing'
172
-    }, 2500);
173
+    }, NOTIFICATION_TIMEOUT);
173 174
 }
174 175
 
175 176
 

Загрузка…
Отмена
Сохранить