allow logging in w/ a click, not just enter

This commit is contained in:
Tao Bror Bojlén 2019-08-20 10:16:05 +02:00
parent 7427a78b65
commit d5d4a5f0f0
No known key found for this signature in database
GPG key ID: C6EC7AAB905F9E6F
2 changed files with 7 additions and 2 deletions

View file

@ -18,6 +18,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed
- Added ON DELETE to `most_recent_crawl` table, such that it can handle previously-crawled but now-dead instances.
- You can now login to the admin view by clicking, not just by pressing enter.
## [2.7.0 - 2018-08-18]

View file

@ -86,6 +86,7 @@ class LoginScreen extends React.PureComponent<{}, ILoginScreenState> {
private renderChooseInstance = () => {
const { isGettingLoginTypes } = this.state;
const onButtonClick = () => this.getLoginTypes();
return (
<form onSubmit={this.getLoginTypes}>
<FormGroup label="Instance domain" labelFor="domain-input" disabled={isGettingLoginTypes} inline={true}>
@ -101,6 +102,7 @@ class LoginScreen extends React.PureComponent<{}, ILoginScreenState> {
rightIcon={IconNames.ARROW_RIGHT}
title="submit"
loading={isGettingLoginTypes}
onClick={onButtonClick}
/>
}
placeholder="mastodon.social"
@ -166,8 +168,10 @@ class LoginScreen extends React.PureComponent<{}, ILoginScreenState> {
this.setState({ domain: event.target.value });
};
private getLoginTypes = (e: React.FormEvent<HTMLFormElement>) => {
private getLoginTypes = (e?: React.FormEvent<HTMLFormElement>) => {
if (!!e) {
e.preventDefault();
}
this.setState({ isGettingLoginTypes: true });
let { domain } = this.state;
if (domain.startsWith("https://")) {