diff --git a/react/features/recording/actionTypes.js b/react/features/recording/actionTypes.js index c67f6f4ea..593aa0831 100644 --- a/react/features/recording/actionTypes.js +++ b/react/features/recording/actionTypes.js @@ -37,6 +37,16 @@ export const RECORDING_SESSION_UPDATED = 'RECORDING_SESSION_UPDATED'; export const SET_PENDING_RECORDING_NOTIFICATION_UID = 'SET_PENDING_RECORDING_NOTIFICATION_UID'; +/** + * The type of Redux action which sets the selected recording service. + * + * { + * type: SET_SELECTED_RECORDING_SERVICE + * } + * @public + */ +export const SET_SELECTED_RECORDING_SERVICE = 'SET_SELECTED_RECORDING_SERVICE'; + /** * Sets the stream key last used by the user for later reuse. * diff --git a/react/features/recording/actions.any.js b/react/features/recording/actions.any.js index 3ec2c27e0..7bdcf2eec 100644 --- a/react/features/recording/actions.any.js +++ b/react/features/recording/actions.any.js @@ -16,9 +16,10 @@ import { CLEAR_RECORDING_SESSIONS, RECORDING_SESSION_UPDATED, SET_PENDING_RECORDING_NOTIFICATION_UID, + SET_SELECTED_RECORDING_SERVICE, SET_STREAM_KEY } from './actionTypes'; -import { getRecordingLink, getResourceId } from './functions'; +import { getRecordingLink, getResourceId, isSavingRecordingOnDropbox } from './functions'; import logger from './logger'; /** @@ -179,7 +180,8 @@ export function showStartedRecordingNotification( // fetch the recording link from the server for recording initiators in jaas meetings if (recordingSharingUrl && isVpaasMeeting(state) - && iAmRecordingInitiator) { + && iAmRecordingInitiator + && !isSavingRecordingOnDropbox(state)) { const region = getMeetingRegion(state); const tenant = getVpaasTenant(state); @@ -238,6 +240,19 @@ export function updateRecordingSessionData(session: Object) { }; } +/** + * Sets the selected recording service. + * + * @param {string} selectedRecordingService - The new selected recording service. + * @returns {Object} + */ +export function setSelectedRecordingService(selectedRecordingService: string) { + return { + type: SET_SELECTED_RECORDING_SERVICE, + selectedRecordingService + }; +} + /** * Sets UID of the the pending streaming notification to use it when hinding * the notification is necessary, or unsets it when undefined (or no param) is diff --git a/react/features/recording/components/Recording/AbstractStartRecordingDialog.js b/react/features/recording/components/Recording/AbstractStartRecordingDialog.js index 073d143c0..4b30bc62c 100644 --- a/react/features/recording/components/Recording/AbstractStartRecordingDialog.js +++ b/react/features/recording/components/Recording/AbstractStartRecordingDialog.js @@ -12,6 +12,7 @@ import { isEnabled as isDropboxEnabled } from '../../../dropbox'; import { toggleRequestingSubtitles } from '../../../subtitles'; +import { setSelectedRecordingService } from '../../actions'; import { RECORDING_TYPES } from '../../constants'; type Props = { @@ -196,7 +197,9 @@ class AbstractStartRecordingDialog extends Component { * @returns {void} */ _onSelectedRecordingServiceChanged(selectedRecordingService) { - this.setState({ selectedRecordingService }); + this.setState({ selectedRecordingService }, () => { + this.props.dispatch(setSelectedRecordingService(selectedRecordingService)); + }); } /** diff --git a/react/features/recording/functions.js b/react/features/recording/functions.js index 678d254ab..7206f5115 100644 --- a/react/features/recording/functions.js +++ b/react/features/recording/functions.js @@ -1,8 +1,9 @@ // @flow import { JitsiRecordingConstants } from '../base/lib-jitsi-meet'; +import { isEnabled as isDropboxEnabled } from '../dropbox'; -import { RECORDING_STATUS_PRIORITIES } from './constants'; +import { RECORDING_STATUS_PRIORITIES, RECORDING_TYPES } from './constants'; /** * Searches in the passed in redux state for an active recording session of the @@ -67,6 +68,17 @@ export async function getRecordingLink(url: string, recordingSessionId: string, return res.ok ? json.url : Promise.reject(json); } +/** + * Selector used for determining if recording is saved on dropbox. + * + * @param {Object} state - The redux state to search in. + * @returns {string} + */ +export function isSavingRecordingOnDropbox(state: Object) { + return isDropboxEnabled(state) + && state['features/recording'].selectedRecordingService === RECORDING_TYPES.DROPBOX; +} + /** * Returns the recording session status that is to be shown in a label. E.g. If * there is a session with the status OFF and one with PENDING, then the PENDING diff --git a/react/features/recording/reducer.js b/react/features/recording/reducer.js index 71bd3aa31..e63efa8a1 100644 --- a/react/features/recording/reducer.js +++ b/react/features/recording/reducer.js @@ -4,11 +4,13 @@ import { CLEAR_RECORDING_SESSIONS, RECORDING_SESSION_UPDATED, SET_PENDING_RECORDING_NOTIFICATION_UID, + SET_SELECTED_RECORDING_SERVICE, SET_STREAM_KEY } from './actionTypes'; const DEFAULT_STATE = { pendingNotificationUids: {}, + selectedRecordingService: '', sessionDatas: [] }; @@ -50,6 +52,13 @@ ReducerRegistry.register(STORE_NAME, }; } + case SET_SELECTED_RECORDING_SERVICE: { + return { + ...state, + selectedRecordingService: action.selectedRecordingService + }; + } + case SET_STREAM_KEY: return { ...state,