Ver código fonte

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

master
hmuresan 3 anos atrás
pai
commit
1c8103c444

+ 1
- 0
lang/main.json Ver arquivo

@@ -263,6 +263,7 @@
263 263
         "muteParticipantsVideoButton": "Disable camera",
264 264
         "muteParticipantsVideoTitle": "Disable camera of this participant?",
265 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 267
         "Ok": "OK",
267 268
         "password": "Password",
268 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 Ver arquivo

@@ -11,6 +11,7 @@ import {
11 11
     getDropboxData,
12 12
     isEnabled as isDropboxEnabled
13 13
 } from '../../../dropbox';
14
+import { showErrorNotification } from '../../../notifications';
14 15
 import { toggleRequestingSubtitles } from '../../../subtitles';
15 16
 import { setSelectedRecordingService } from '../../actions';
16 17
 import { RECORDING_TYPES } from '../../constants';
@@ -254,19 +255,24 @@ class AbstractStartRecordingDialog extends Component<Props, State> {
254 255
         let appData;
255 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 276
         } else {
271 277
             appData = JSON.stringify({
272 278
                 'file_recording_metadata': {

Carregando…
Cancelar
Salvar