From 77227eaa2a744be53457acfeb004356e675a46fb Mon Sep 17 00:00:00 2001 From: Audric Ackermann Date: Tue, 21 Jan 2020 11:23:12 +1100 Subject: [PATCH] fix password toast display --- ts/components/session/RegistrationTabs.tsx | 17 ++++++++++++++--- .../session/SessionClosableOverlay.tsx | 2 +- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/ts/components/session/RegistrationTabs.tsx b/ts/components/session/RegistrationTabs.tsx index 47f7eeb8c..1602bcfbe 100644 --- a/ts/components/session/RegistrationTabs.tsx +++ b/ts/components/session/RegistrationTabs.tsx @@ -437,7 +437,7 @@ export class RegistrationTabs extends React.Component<{}, State> { } private renderNamePasswordAndVerifyPasswordFields() { - const passwordDoesNotMatchString = + const passwordsDoNotMatch = !this.state.passwordFieldsMatch && this.state.password ? window.i18n('passwordsDoNotMatch') : undefined; @@ -472,7 +472,7 @@ export class RegistrationTabs extends React.Component<{}, State> { { @@ -735,7 +735,7 @@ export class RegistrationTabs extends React.Component<{}, State> { passwordFieldsMatch, } = this.state; // Make sure the password is valid - if (passwordErrorString || passwordFieldsMatch) { + if (passwordErrorString) { window.pushToast({ title: window.i18n('invalidPassword'), type: 'error', @@ -744,6 +744,17 @@ export class RegistrationTabs extends React.Component<{}, State> { return; } + + if (!!password && !passwordFieldsMatch) { + window.pushToast({ + title: window.i18n('passwordsDoNotMatch'), + type: 'error', + id: 'invalidPassword', + }); + + return; + } + if (!mnemonicSeed) { return; } diff --git a/ts/components/session/SessionClosableOverlay.tsx b/ts/components/session/SessionClosableOverlay.tsx index 8299d7aef..3737089a9 100644 --- a/ts/components/session/SessionClosableOverlay.tsx +++ b/ts/components/session/SessionClosableOverlay.tsx @@ -57,7 +57,7 @@ export class SessionClosableOverlay extends React.Component { break; case 'contact': title = window.i18n('addContact'); - buttonText = window.i18n('addContact'); + buttonText = window.i18n('next'); descriptionLong = window.i18n('usersCanShareTheir...'); subtitle = window.i18n('enterSessionID'); placeholder = window.i18n('pasteSessionIDRecipient');