mirror of
https://github.com/ecency/ecency-mobile.git
synced 2024-12-22 21:01:31 +03:00
Login screen fixed for offline mode
This commit is contained in:
parent
5ef3253618
commit
8a513ecd0c
@ -203,7 +203,9 @@
|
|||||||
"no_internet": "No connection!",
|
"no_internet": "No connection!",
|
||||||
"confirm": "Confirm",
|
"confirm": "Confirm",
|
||||||
"removed": "Removed",
|
"removed": "Removed",
|
||||||
"same_user": "This user already added to list"
|
"same_user": "This user already added to list",
|
||||||
|
"unknow_error": "An error occurred",
|
||||||
|
"error": "Error"
|
||||||
},
|
},
|
||||||
"post": {
|
"post": {
|
||||||
"reblog_alert": "Are you sure you want to reblog?",
|
"reblog_alert": "Are you sure you want to reblog?",
|
||||||
|
@ -108,13 +108,29 @@ class LoginContainer extends PureComponent {
|
|||||||
};
|
};
|
||||||
|
|
||||||
_getAccountsWithUsername = async username => {
|
_getAccountsWithUsername = async username => {
|
||||||
|
const { intl, isConnected } = this.props;
|
||||||
|
|
||||||
|
if (isConnected) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
const validUsers = await lookupAccounts(username);
|
const validUsers = await lookupAccounts(username);
|
||||||
|
|
||||||
return validUsers;
|
return validUsers;
|
||||||
|
} catch (error) {
|
||||||
|
Alert.alert(
|
||||||
|
intl.formatMessage({ id: 'alert.error' }),
|
||||||
|
intl.formatMessage({ d: 'alert.unknow_error' }),
|
||||||
|
);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
_handleSignUp = () => {
|
_handleSignUp = () => {
|
||||||
|
const { intl } = this.props;
|
||||||
|
|
||||||
Linking.openURL('https://signup.steemit.com/?ref=esteem').catch(err =>
|
Linking.openURL('https://signup.steemit.com/?ref=esteem').catch(err =>
|
||||||
alert('An error occurred', err),
|
Alert.alert(intl.formatMessage({ id: 'alert.error' }), err.message),
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -137,6 +153,7 @@ const mapStateToProps = state => ({
|
|||||||
account: state.accounts,
|
account: state.accounts,
|
||||||
notificationDetails: state.application.notificationDetails,
|
notificationDetails: state.application.notificationDetails,
|
||||||
notificationSettings: state.application.isNotificationOpen,
|
notificationSettings: state.application.isNotificationOpen,
|
||||||
|
isConnected: state.application.isConnected,
|
||||||
});
|
});
|
||||||
|
|
||||||
export default injectIntl(connect(mapStateToProps)(LoginContainer));
|
export default injectIntl(connect(mapStateToProps)(LoginContainer));
|
||||||
|
Loading…
Reference in New Issue
Block a user