Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

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

Saúl Ibarra Corretgéde7c9bd001e0
diff --git a/package-lock.json b/package-lock.json
index faf8c6bd05..855de4cc33 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -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",
diff --git a/package.json b/package.json
index c24ac76219..e1ed6c81ac 100644
--- a/package.json
+++ b/package.json
@@ -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",
diff --git a/react/features/toolbox/components/native/OverflowMenu.js b/react/features/toolbox/components/native/OverflowMenu.js
index cf095e0b3b..d27d44c4c9 100644
--- a/react/features/toolbox/components/native/OverflowMenu.js
+++ b/react/features/toolbox/components/native/OverflowMenu.js
@@ -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';
/**
diff --git a/react/features/toolbox/components/native/ScreenSharingButton.js b/react/features/toolbox/components/native/ScreenSharingButton.tsx
similarity index 68%
rename from react/features/toolbox/components/native/ScreenSharingButton.js
rename to react/features/toolbox/components/native/ScreenSharingButton.tsx
index f0cfe8fd29..01b3d1c94c 100644
--- a/react/features/toolbox/components/native/ScreenSharingButton.js
+++ b/react/features/toolbox/components/native/ScreenSharingButton.tsx
@@ -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)
};
}