From be27464b08b6f2e387abcc16e4204b998175bbd3 Mon Sep 17 00:00:00 2001 From: Hristo Terezov Date: Thu, 20 Jan 2022 18:52:19 -0600 Subject: [PATCH] fix(screen-capture): disable. --- modules/API/API.js | 8 +++++-- .../Recording/web/StopRecordingDialog.js | 21 +++++++++++++++++-- 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/modules/API/API.js b/modules/API/API.js index 1a076867e..298dd7ca1 100644 --- a/modules/API/API.js +++ b/modules/API/API.js @@ -481,7 +481,9 @@ function initCommands() { return; } - if (isScreenVideoShared(APP.store.getState())) { + const enableScreenshotCapture = state['features/base/config'].enableScreenshotCapture; + + if (enableScreenshotCapture && isScreenVideoShared(state)) { APP.store.dispatch(toggleScreenshotCaptureSummary(true)); } conference.startRecording(recordingConfig); @@ -512,7 +514,9 @@ function initCommands() { const activeSession = getActiveSession(state, mode); if (activeSession && activeSession.id) { - APP.store.dispatch(toggleScreenshotCaptureSummary(false)); + if (state['features/base/config'].enableScreenshotCapture) { + APP.store.dispatch(toggleScreenshotCaptureSummary(false)); + } conference.stopRecording(activeSession.id); } else { logger.error('No recording or streaming session found'); diff --git a/react/features/recording/components/Recording/web/StopRecordingDialog.js b/react/features/recording/components/Recording/web/StopRecordingDialog.js index 21db4f22a..e3b73e971 100644 --- a/react/features/recording/components/Recording/web/StopRecordingDialog.js +++ b/react/features/recording/components/Recording/web/StopRecordingDialog.js @@ -8,7 +8,7 @@ import { connect } from '../../../../base/redux'; import { toggleScreenshotCaptureSummary } from '../../../../screenshot-capture'; import AbstractStopRecordingDialog, { type Props, - _mapStateToProps + _mapStateToProps as abstractMapStateToProps } from '../AbstractStopRecordingDialog'; /** @@ -46,8 +46,25 @@ class StopRecordingDialog extends AbstractStopRecordingDialog { * @returns {void} */ _toggleScreenshotCapture() { - this.props.dispatch(toggleScreenshotCaptureSummary(false)); + const { dispatch, _screenshotCaptureEnabled } = this.props; + + if (_screenshotCaptureEnabled) { + dispatch(toggleScreenshotCaptureSummary(false)); + } } } +/** + * Maps redux state to component props. + * + * @param {Object} state - Redux state. + * @returns {Object} + */ +function _mapStateToProps(state) { + return { + ...abstractMapStateToProps(state), + _screenshotCaptureEnabled: state['features/base/config'].enableScreenshotCapture + }; +} + export default translate(connect(_mapStateToProps)(StopRecordingDialog));