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", "muteParticipantsVideoButton": "Disable camera",
"muteParticipantsVideoTitle": "Disable camera of this participant?", "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.", "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", "Ok": "OK",
"password": "Password", "password": "Password",
"passwordLabel": "The meeting has been locked by a participant. Please enter the $t(lockRoomPassword) to join.", "passwordLabel": "The meeting has been locked by a participant. Please enter the $t(lockRoomPassword) to join.",

View File

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