瀏覽代碼

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

Just like the web.
master
Saúl Ibarra Corretgé 3 年之前
父節點
當前提交
de7c9bd001

+ 19
- 0
package-lock.json 查看文件

@@ -140,6 +140,7 @@
140 140
         "@babel/preset-react": "7.16.0",
141 141
         "@babel/runtime": "7.16.0",
142 142
         "@jitsi/eslint-config": "4.0.0",
143
+        "@types/react-native": "0.67.6",
143 144
         "babel-loader": "8.2.3",
144 145
         "babel-plugin-optional-require": "0.3.1",
145 146
         "circular-dependency-plugin": "5.2.0",
@@ -5499,6 +5500,15 @@
5499 5500
         "csstype": "^3.0.2"
5500 5501
       }
5501 5502
     },
5503
+    "node_modules/@types/react-native": {
5504
+      "version": "0.67.6",
5505
+      "resolved": "https://registry.npmjs.org/@types/react-native/-/react-native-0.67.6.tgz",
5506
+      "integrity": "sha512-NM6atxrefIXMLE/PyQ1bIQjQ/lWLdls3uVxItzKvNUUVZlGqgn/uGN4MarM9quSf90uSqJYPIAeAgTtBTUjhgg==",
5507
+      "dev": true,
5508
+      "dependencies": {
5509
+        "@types/react": "*"
5510
+      }
5511
+    },
5502 5512
     "node_modules/@types/react-transition-group": {
5503 5513
       "version": "4.4.4",
5504 5514
       "resolved": "https://registry.npmjs.org/@types/react-transition-group/-/react-transition-group-4.4.4.tgz",
@@ -24106,6 +24116,15 @@
24106 24116
         "csstype": "^3.0.2"
24107 24117
       }
24108 24118
     },
24119
+    "@types/react-native": {
24120
+      "version": "0.67.6",
24121
+      "resolved": "https://registry.npmjs.org/@types/react-native/-/react-native-0.67.6.tgz",
24122
+      "integrity": "sha512-NM6atxrefIXMLE/PyQ1bIQjQ/lWLdls3uVxItzKvNUUVZlGqgn/uGN4MarM9quSf90uSqJYPIAeAgTtBTUjhgg==",
24123
+      "dev": true,
24124
+      "requires": {
24125
+        "@types/react": "*"
24126
+      }
24127
+    },
24109 24128
     "@types/react-transition-group": {
24110 24129
       "version": "4.4.4",
24111 24130
       "resolved": "https://registry.npmjs.org/@types/react-transition-group/-/react-transition-group-4.4.4.tgz",

+ 1
- 0
package.json 查看文件

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

+ 1
- 1
react/features/toolbox/components/native/OverflowMenu.js 查看文件

@@ -25,7 +25,7 @@ import HelpButton from '../HelpButton';
25 25
 import AudioOnlyButton from './AudioOnlyButton';
26 26
 import LinkToSalesforceButton from './LinkToSalesforceButton';
27 27
 import RaiseHandButton from './RaiseHandButton';
28
-import ScreenSharingButton from './ScreenSharingButton.js';
28
+import ScreenSharingButton from './ScreenSharingButton';
29 29
 import ToggleCameraButton from './ToggleCameraButton';
30 30
 
31 31
 /**

react/features/toolbox/components/native/ScreenSharingButton.js → react/features/toolbox/components/native/ScreenSharingButton.tsx 查看文件

@@ -1,10 +1,8 @@
1
-// @flow
2
-
3 1
 import React from 'react';
4 2
 import { Platform } from 'react-native';
5 3
 
6 4
 import { connect } from '../../../base/redux';
7
-import { isDesktopShareButtonDisabled } from '../../functions';
5
+import { isDesktopShareButtonDisabled } from '../../functions.native';
8 6
 
9 7
 import ScreenSharingAndroidButton from './ScreenSharingAndroidButton.js';
10 8
 import ScreenSharingIosButton from './ScreenSharingIosButton.js';
@@ -24,17 +22,12 @@ const ScreenSharingButton = props => (
24 22
  * Maps (parts of) the redux state to the associated props for the
25 23
  * {@code ScreenSharingButton} component.
26 24
  *
27
- * @param {Object} state - The Redux state.
25
+ * @param state - The Redux state.
28 26
  * @private
29
- * @returns {{
30
- *     _disabled: boolean,
31
- * }}
32 27
  */
33
-function _mapStateToProps(state): Object {
34
-    const disabled = state['features/base/audio-only'].enabled || isDesktopShareButtonDisabled(state);
35
-
28
+function _mapStateToProps(state: object): object {
36 29
     return {
37
-        _disabled: disabled
30
+        _disabled: isDesktopShareButtonDisabled(state)
38 31
     };
39 32
 }
40 33
 

Loading…
取消
儲存