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

This commit is contained in:
hmuresan 2021-07-21 16:20:45 +03:00 committed by Horatiu Muresan
parent 4e83e93eb6
commit 1c8103c444
2 changed files with 19 additions and 12 deletions

View File

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

View File

@ -11,6 +11,7 @@ import {
getDropboxData,
isEnabled as isDropboxEnabled
} from '../../../dropbox';
import { showErrorNotification } from '../../../notifications';
import { toggleRequestingSubtitles } from '../../../subtitles';
import { setSelectedRecordingService } from '../../actions';
import { RECORDING_TYPES } from '../../constants';
@ -254,19 +255,24 @@ class AbstractStartRecordingDialog extends Component<Props, State> {
let appData;
const attributes = {};
if (_isDropboxEnabled
&& _token
&& this.state.selectedRecordingService
=== RECORDING_TYPES.DROPBOX) {
appData = JSON.stringify({
'file_recording_metadata': {
'upload_credentials': {
'service_name': RECORDING_TYPES.DROPBOX,
'token': _token
if (_isDropboxEnabled && this.state.selectedRecordingService === RECORDING_TYPES.DROPBOX) {
if (_token) {
appData = JSON.stringify({
'file_recording_metadata': {
'upload_credentials': {
'service_name': RECORDING_TYPES.DROPBOX,
'token': _token
}
}
}
});
attributes.type = RECORDING_TYPES.DROPBOX;
});
attributes.type = RECORDING_TYPES.DROPBOX;
} else {
dispatch(showErrorNotification({
titleKey: 'dialog.noDropboxToken'
}));
return;
}
} else {
appData = JSON.stringify({
'file_recording_metadata': {