diff options
| author | Oskar Nyberg <oskar@mullvad.net> | 2021-07-01 17:36:11 +0200 |
|---|---|---|
| committer | Oskar Nyberg <oskar@mullvad.net> | 2021-07-01 17:36:11 +0200 |
| commit | 88e98d0dc1a54a90961baad67602649dd087b3ea (patch) | |
| tree | ae3dea211cc5616ab3b734a75605e39929dbb723 | |
| parent | 94aa0434b8479ff6d37290a7621ed3d21b62bbb1 (diff) | |
| parent | 45fc33682c5ba922543ebcd94fef06062d728068 (diff) | |
| download | mullvadvpn-88e98d0dc1a54a90961baad67602649dd087b3ea.tar.xz mullvadvpn-88e98d0dc1a54a90961baad67602649dd087b3ea.zip | |
Merge branch 'prevent-login-when-removing-history'
| -rw-r--r-- | CHANGELOG.md | 2 | ||||
| -rw-r--r-- | gui/src/renderer/components/Login.tsx | 14 |
2 files changed, 11 insertions, 5 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 0cbc145f6f..5e6a3652e0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -33,6 +33,8 @@ Line wrap the file at 100 chars. Th ### Fixed - Fix link to download page not always using the beta URL when it should. - Fix deadlock that may occur when the API cannot be reached while entering the connecting state. +- Fix bug causing desktop app to log in if account number field was filled when removing account + history. #### Linux - Make offline monitor aware of routing table changes. diff --git a/gui/src/renderer/components/Login.tsx b/gui/src/renderer/components/Login.tsx index e672094f99..29923d7d0f 100644 --- a/gui/src/renderer/components/Login.tsx +++ b/gui/src/renderer/components/Login.tsx @@ -276,8 +276,7 @@ export default class Login extends React.Component<IProps, IState> { aria-label={ // TRANSLATORS: This is used by screenreaders to communicate the login button. messages.pgettext('accessibility', 'Login') - } - onClick={this.onSubmit}> + }> <StyledInputSubmitIcon visible={this.props.loginState.type !== 'logging in'} source="icon-arrow" @@ -351,9 +350,14 @@ function AccountDropdownItem(props: IAccountDropdownItemProps) { props.onSelect(props.value); }, [props.onSelect, props.value]); - const handleRemove = useCallback(() => { - props.onRemove(props.value); - }, [props.onRemove, props.value]); + const handleRemove = useCallback( + (event) => { + // Prevent login form from submitting + event.preventDefault(); + props.onRemove(props.value); + }, + [props.onRemove, props.value], + ); return ( <> |
