Преглед на файлове

fix(dropbox-recording) Prevent start recording when no dropbox token

master
hmuresan преди 3 години
родител
ревизия
1c8103c444
променени са 2 файла, в които са добавени 19 реда и са изтрити 12 реда
  1. 1
    0
      lang/main.json
  2. 18
    12
      react/features/recording/components/Recording/AbstractStartRecordingDialog.js

+ 1
- 0
lang/main.json Целия файл

263
         "muteParticipantsVideoButton": "Disable camera",
263
         "muteParticipantsVideoButton": "Disable camera",
264
         "muteParticipantsVideoTitle": "Disable camera of this participant?",
264
         "muteParticipantsVideoTitle": "Disable camera of this participant?",
265
         "muteParticipantsVideoBody": "You won't be able to turn the camera back on, but they can turn it back on at any time.",
265
         "muteParticipantsVideoBody": "You won't be able to turn the camera back on, but they can turn it back on at any time.",
266
+        "noDropboxToken": "No valid Dropbox token",
266
         "Ok": "OK",
267
         "Ok": "OK",
267
         "password": "Password",
268
         "password": "Password",
268
         "passwordLabel": "The meeting has been locked by a participant. Please enter the $t(lockRoomPassword) to join.",
269
         "passwordLabel": "The meeting has been locked by a participant. Please enter the $t(lockRoomPassword) to join.",

+ 18
- 12
react/features/recording/components/Recording/AbstractStartRecordingDialog.js Целия файл

11
     getDropboxData,
11
     getDropboxData,
12
     isEnabled as isDropboxEnabled
12
     isEnabled as isDropboxEnabled
13
 } from '../../../dropbox';
13
 } from '../../../dropbox';
14
+import { showErrorNotification } from '../../../notifications';
14
 import { toggleRequestingSubtitles } from '../../../subtitles';
15
 import { toggleRequestingSubtitles } from '../../../subtitles';
15
 import { setSelectedRecordingService } from '../../actions';
16
 import { setSelectedRecordingService } from '../../actions';
16
 import { RECORDING_TYPES } from '../../constants';
17
 import { RECORDING_TYPES } from '../../constants';
254
         let appData;
255
         let appData;
255
         const attributes = {};
256
         const attributes = {};
256
 
257
 
257
-        if (_isDropboxEnabled
258
-                && _token
259
-                && this.state.selectedRecordingService
260
-                    === RECORDING_TYPES.DROPBOX) {
261
-            appData = JSON.stringify({
262
-                'file_recording_metadata': {
263
-                    'upload_credentials': {
264
-                        'service_name': RECORDING_TYPES.DROPBOX,
265
-                        'token': _token
258
+        if (_isDropboxEnabled && this.state.selectedRecordingService === RECORDING_TYPES.DROPBOX) {
259
+            if (_token) {
260
+                appData = JSON.stringify({
261
+                    'file_recording_metadata': {
262
+                        'upload_credentials': {
263
+                            'service_name': RECORDING_TYPES.DROPBOX,
264
+                            'token': _token
265
+                        }
266
                     }
266
                     }
267
-                }
268
-            });
269
-            attributes.type = RECORDING_TYPES.DROPBOX;
267
+                });
268
+                attributes.type = RECORDING_TYPES.DROPBOX;
269
+            } else {
270
+                dispatch(showErrorNotification({
271
+                    titleKey: 'dialog.noDropboxToken'
272
+                }));
273
+
274
+                return;
275
+            }
270
         } else {
276
         } else {
271
             appData = JSON.stringify({
277
             appData = JSON.stringify({
272
                 'file_recording_metadata': {
278
                 'file_recording_metadata': {

Loading…
Отказ
Запис