From 0ccfbbb5747df1f2ae54b0988042cd3177fb5c63 Mon Sep 17 00:00:00 2001 From: Rodrigo Nascimento Date: Sun, 13 Aug 2017 20:14:02 -0300 Subject: [PATCH] Fix login and use login placeholders from settings --- app/lib/rocketchat.js | 1 - app/views/login.js | 14 +++++++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/app/lib/rocketchat.js b/app/lib/rocketchat.js index d67abd5a..f8330315 100644 --- a/app/lib/rocketchat.js +++ b/app/lib/rocketchat.js @@ -190,7 +190,6 @@ const RocketChat = { } } - console.log({ params }); this.login(params, callback); }, diff --git a/app/views/login.js b/app/views/login.js index 9d27f2df..3fa97137 100644 --- a/app/views/login.js +++ b/app/views/login.js @@ -29,14 +29,18 @@ const styles = StyleSheet.create({ }); @connect(state => ({ - server: state.server + server: state.server, + Accounts_EmailOrUsernamePlaceholder: state.settings.Accounts_EmailOrUsernamePlaceholder, + Accounts_PasswordPlaceholder: state.settings.Accounts_PasswordPlaceholder }), dispatch => ({ actions: bindActionCreators(actions, dispatch) })) export default class LoginView extends React.Component { static propTypes = { navigator: PropTypes.object.isRequired, - server: PropTypes.string.isRequired + server: PropTypes.string.isRequired, + Accounts_EmailOrUsernamePlaceholder: PropTypes.string, + Accounts_PasswordPlaceholder: PropTypes.string } static navigationOptions = () => ({ @@ -63,7 +67,7 @@ export default class LoginView extends React.Component { } submit = () => { - RocketChat.loginWithPassword({ username: this.state.username }, this.state.password, () => { + RocketChat.loginWithPassword(this.state.username, this.state.password, () => { this.props.navigator.dismissModal(); }); } @@ -80,7 +84,7 @@ export default class LoginView extends React.Component { autoCapitalize='none' autoFocus onSubmitEditing={this.submit} - placeholder='Email or username' + placeholder={this.props.Accounts_EmailOrUsernamePlaceholder || 'Email or username'} /> );