fix(rn,screen-sharing) don't disable button when in audio-only mode

Just like the web.
This commit is contained in:
Saúl Ibarra Corretgé 2022-05-03 12:07:22 +02:00 committed by Saúl Ibarra Corretgé
parent fd62ca6c67
commit de7c9bd001
4 changed files with 25 additions and 12 deletions

19
package-lock.json generated
View File

@ -140,6 +140,7 @@
"@babel/preset-react": "7.16.0",
"@babel/runtime": "7.16.0",
"@jitsi/eslint-config": "4.0.0",
"@types/react-native": "0.67.6",
"babel-loader": "8.2.3",
"babel-plugin-optional-require": "0.3.1",
"circular-dependency-plugin": "5.2.0",
@ -5499,6 +5500,15 @@
"csstype": "^3.0.2"
}
},
"node_modules/@types/react-native": {
"version": "0.67.6",
"resolved": "https://registry.npmjs.org/@types/react-native/-/react-native-0.67.6.tgz",
"integrity": "sha512-NM6atxrefIXMLE/PyQ1bIQjQ/lWLdls3uVxItzKvNUUVZlGqgn/uGN4MarM9quSf90uSqJYPIAeAgTtBTUjhgg==",
"dev": true,
"dependencies": {
"@types/react": "*"
}
},
"node_modules/@types/react-transition-group": {
"version": "4.4.4",
"resolved": "https://registry.npmjs.org/@types/react-transition-group/-/react-transition-group-4.4.4.tgz",
@ -24106,6 +24116,15 @@
"csstype": "^3.0.2"
}
},
"@types/react-native": {
"version": "0.67.6",
"resolved": "https://registry.npmjs.org/@types/react-native/-/react-native-0.67.6.tgz",
"integrity": "sha512-NM6atxrefIXMLE/PyQ1bIQjQ/lWLdls3uVxItzKvNUUVZlGqgn/uGN4MarM9quSf90uSqJYPIAeAgTtBTUjhgg==",
"dev": true,
"requires": {
"@types/react": "*"
}
},
"@types/react-transition-group": {
"version": "4.4.4",
"resolved": "https://registry.npmjs.org/@types/react-transition-group/-/react-transition-group-4.4.4.tgz",

View File

@ -145,6 +145,7 @@
"@babel/preset-react": "7.16.0",
"@babel/runtime": "7.16.0",
"@jitsi/eslint-config": "4.0.0",
"@types/react-native": "0.67.6",
"babel-loader": "8.2.3",
"babel-plugin-optional-require": "0.3.1",
"circular-dependency-plugin": "5.2.0",

View File

@ -25,7 +25,7 @@ import HelpButton from '../HelpButton';
import AudioOnlyButton from './AudioOnlyButton';
import LinkToSalesforceButton from './LinkToSalesforceButton';
import RaiseHandButton from './RaiseHandButton';
import ScreenSharingButton from './ScreenSharingButton.js';
import ScreenSharingButton from './ScreenSharingButton';
import ToggleCameraButton from './ToggleCameraButton';
/**

View File

@ -1,10 +1,8 @@
// @flow
import React from 'react';
import { Platform } from 'react-native';
import { connect } from '../../../base/redux';
import { isDesktopShareButtonDisabled } from '../../functions';
import { isDesktopShareButtonDisabled } from '../../functions.native';
import ScreenSharingAndroidButton from './ScreenSharingAndroidButton.js';
import ScreenSharingIosButton from './ScreenSharingIosButton.js';
@ -24,17 +22,12 @@ const ScreenSharingButton = props => (
* Maps (parts of) the redux state to the associated props for the
* {@code ScreenSharingButton} component.
*
* @param {Object} state - The Redux state.
* @param state - The Redux state.
* @private
* @returns {{
* _disabled: boolean,
* }}
*/
function _mapStateToProps(state): Object {
const disabled = state['features/base/audio-only'].enabled || isDesktopShareButtonDisabled(state);
function _mapStateToProps(state: object): object {
return {
_disabled: disabled
_disabled: isDesktopShareButtonDisabled(state)
};
}