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,room-lock) use numeric input for password dialog if appropriate (#14142)

Saúl Ibarra Corretgédd232f55a9c1
diff --git a/react/features/room-lock/components/PasswordRequiredPrompt.native.tsx b/react/features/room-lock/components/PasswordRequiredPrompt.native.tsx
index 5dccc75e1c..bedffa3203 100644
--- a/react/features/room-lock/components/PasswordRequiredPrompt.native.tsx
+++ b/react/features/room-lock/components/PasswordRequiredPrompt.native.tsx
@@ -17,6 +17,11 @@ interface IProps {
*/
_password?: string;
+ /**
+ * Number of digits used in the room-lock password.
+ */
+ _passwordNumberOfDigits?: number;
+
/**
* The {@code JitsiConference} which requires a password.
*
@@ -88,6 +93,15 @@ class PasswordRequiredPrompt extends Component<IProps, IState> {
*/
render() {
const { password } = this.state;
+ const { _passwordNumberOfDigits } = this.props;
+ const textInputProps: any = {
+ secureTextEntry: true
+ };
+
+ if (_passwordNumberOfDigits) {
+ textInputProps.keyboardType = 'numeric';
+ textInputProps.maxLength = _passwordNumberOfDigits;
+ }
return (
<InputDialog
@@ -96,9 +110,7 @@ class PasswordRequiredPrompt extends Component<IProps, IState> {
messageKey = { password ? 'dialog.incorrectRoomLockPassword' : undefined }
onCancel = { this._onCancel }
onSubmit = { this._onSubmit }
- textInputProps = {{
- secureTextEntry: true
- }}
+ textInputProps = { textInputProps }
titleKey = 'dialog.password' />
);
}
@@ -142,8 +154,11 @@ class PasswordRequiredPrompt extends Component<IProps, IState> {
* @returns {IProps}
*/
function _mapStateToProps(state: IReduxState) {
+ const { roomPasswordNumberOfDigits } = state['features/base/config'];
+
return {
- _password: state['features/base/conference'].password
+ _password: state['features/base/conference'].password,
+ _passwordNumberOfDigits: roomPasswordNumberOfDigits
};
}