Skip to content

Commit

Permalink
preventDefault on settings form submit. Closes nukeop#35
Browse files Browse the repository at this point in the history
  • Loading branch information
nukeop committed Apr 10, 2017
1 parent 6d9933f commit 61c9542
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion app/components/Settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,12 @@ export default class Settings extends Component {
var labelText = this.props.lastfmConnected ? 'Not logged in' : 'Not connected';

return (
<form onSubmit={this.props.lastfmLogin.bind(null)}>
<form onSubmit={(event) => {
event.preventDefault();
this.props.lastfmLogin.bind(null)();
return false;
}
}>
<div className={styles.settings_lastfm_label}><i style={{color: '#e74c3c'}} className="fa fa-times" /> {labelText}</div>
<button className={`${styles.settings_form} btn btn-default`} type="submit">{buttonText}</button>
</form>
Expand Down

0 comments on commit 61c9542

Please sign in to comment.