diff options
| author | Oskar Nyberg <oskar@mullvad.net> | 2021-12-03 12:16:28 +0100 |
|---|---|---|
| committer | Oskar Nyberg <oskar@mullvad.net> | 2021-12-03 12:16:28 +0100 |
| commit | d4b317d3c3da381775b5f60e932974ffcd2bd898 (patch) | |
| tree | e6cf254ea372319d38eb138f90e0991125afeab4 | |
| parent | 91ba2ee587eab108c9f651215f8806ba353a3ecd (diff) | |
| parent | 43b9bc7ac704f9b9c25b7d2754ad1fcc3b3db539 (diff) | |
| download | mullvadvpn-d4b317d3c3da381775b5f60e932974ffcd2bd898.tar.xz mullvadvpn-d4b317d3c3da381775b5f60e932974ffcd2bd898.zip | |
Merge branch 'disable-account-creation'
| -rw-r--r-- | gui/src/renderer/components/Login.tsx | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/gui/src/renderer/components/Login.tsx b/gui/src/renderer/components/Login.tsx index 96d3929fe0..c7fd1f45cd 100644 --- a/gui/src/renderer/components/Login.tsx +++ b/gui/src/renderer/components/Login.tsx @@ -201,6 +201,11 @@ export default class Login extends React.Component<IProps, IState> { return this.props.loginState.type !== 'logging in' && this.props.loginState.type !== 'ok'; } + private allowCreateAccount() { + const { accountToken } = this.props; + return this.allowInteraction() && (accountToken === undefined || accountToken.length === 0); + } + private accountTokenValid(): boolean { const { accountToken } = this.props; return accountToken !== undefined && accountToken.length >= MIN_ACCOUNT_TOKEN_LENGTH; @@ -251,7 +256,7 @@ export default class Login extends React.Component<IProps, IState> { groupLength={4} placeholder="0000 0000 0000 0000" value={this.props.accountToken || ''} - disabled={!this.allowInteraction()} + disabled={!allowInteraction} onFocus={this.onFocus} onBlur={this.onBlur} handleChange={this.onInputChange} @@ -298,7 +303,7 @@ export default class Login extends React.Component<IProps, IState> { </StyledLoginFooterPrompt> <AppButton.BlueButton onClick={this.props.createNewAccount} - disabled={!this.allowInteraction()}> + disabled={!this.allowCreateAccount()}> {messages.pgettext('login-view', 'Create account')} </AppButton.BlueButton> </> |
