瀏覽代碼

fix(rn,room-lock) use numeric input for password dialog if appropriate (#14142)

factor2
Saúl Ibarra Corretgé 1 年之前
父節點
當前提交
dd232f55a9
沒有連結到貢獻者的電子郵件帳戶。
共有 1 個檔案被更改,包括 19 行新增4 行删除
  1. 19
    4
      react/features/room-lock/components/PasswordRequiredPrompt.native.tsx

+ 19
- 4
react/features/room-lock/components/PasswordRequiredPrompt.native.tsx 查看文件

@@ -17,6 +17,11 @@ interface IProps {
17 17
      */
18 18
     _password?: string;
19 19
 
20
+    /**
21
+     * Number of digits used in the room-lock password.
22
+     */
23
+    _passwordNumberOfDigits?: number;
24
+
20 25
     /**
21 26
      * The {@code JitsiConference} which requires a password.
22 27
      *
@@ -88,6 +93,15 @@ class PasswordRequiredPrompt extends Component<IProps, IState> {
88 93
      */
89 94
     render() {
90 95
         const { password } = this.state;
96
+        const { _passwordNumberOfDigits } = this.props;
97
+        const textInputProps: any = {
98
+            secureTextEntry: true
99
+        };
100
+
101
+        if (_passwordNumberOfDigits) {
102
+            textInputProps.keyboardType = 'numeric';
103
+            textInputProps.maxLength = _passwordNumberOfDigits;
104
+        }
91 105
 
92 106
         return (
93 107
             <InputDialog
@@ -96,9 +110,7 @@ class PasswordRequiredPrompt extends Component<IProps, IState> {
96 110
                 messageKey = { password ? 'dialog.incorrectRoomLockPassword' : undefined }
97 111
                 onCancel = { this._onCancel }
98 112
                 onSubmit = { this._onSubmit }
99
-                textInputProps = {{
100
-                    secureTextEntry: true
101
-                }}
113
+                textInputProps = { textInputProps }
102 114
                 titleKey = 'dialog.password' />
103 115
         );
104 116
     }
@@ -142,8 +154,11 @@ class PasswordRequiredPrompt extends Component<IProps, IState> {
142 154
  * @returns {IProps}
143 155
  */
144 156
 function _mapStateToProps(state: IReduxState) {
157
+    const { roomPasswordNumberOfDigits } = state['features/base/config'];
158
+
145 159
     return {
146
-        _password: state['features/base/conference'].password
160
+        _password: state['features/base/conference'].password,
161
+        _passwordNumberOfDigits: roomPasswordNumberOfDigits
147 162
     };
148 163
 }
149 164
 

Loading…
取消
儲存