From 15738c352567bd2a3546a8e09496ea3bca3be96c Mon Sep 17 00:00:00 2001 From: Audric Ackermann Date: Thu, 20 Feb 2020 13:14:12 +1100 Subject: [PATCH] display continue session signin with seed --- _locales/en/messages.json | 3 +++ js/views/invite_friends_dialog_view.js | 5 +++- .../session/LeftPaneChannelSection.tsx | 24 ++++++++++++------- ts/components/session/RegistrationTabs.tsx | 4 +++- 4 files changed, 26 insertions(+), 10 deletions(-) diff --git a/_locales/en/messages.json b/_locales/en/messages.json index 5ee80af32..a666d6f66 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -2597,6 +2597,9 @@ "message": "Enter other device’s Session ID here" }, "continueYourSession": { + "message": "Continue Your Session" + }, + "linkDevice": { "message": "Link Device" }, "restoreSessionID": { diff --git a/js/views/invite_friends_dialog_view.js b/js/views/invite_friends_dialog_view.js index 1cc7c0ec0..ddf8d5745 100644 --- a/js/views/invite_friends_dialog_view.js +++ b/js/views/invite_friends_dialog_view.js @@ -74,7 +74,10 @@ newMembers.length + existingMembers.length > window.CONSTANTS.SMALL_GROUP_SIZE_LIMIT ) { - const msg = window.i18n('maxGroupMembersError', window.CONSTANTS.SMALL_GROUP_SIZE_LIMIT); + const msg = window.i18n( + 'maxGroupMembersError', + window.CONSTANTS.SMALL_GROUP_SIZE_LIMIT + ); window.pushToast({ title: msg, diff --git a/ts/components/session/LeftPaneChannelSection.tsx b/ts/components/session/LeftPaneChannelSection.tsx index 569d9bec1..fd543ebef 100644 --- a/ts/components/session/LeftPaneChannelSection.tsx +++ b/ts/components/session/LeftPaneChannelSection.tsx @@ -399,13 +399,18 @@ export class LeftPaneChannelSection extends React.Component { groupMembers: Array ) { // Validate groupName and groupMembers length - if (groupName.length === 0 || - groupName.length > window.CONSTANTS.MAX_GROUP_NAME_LENGTH) { - window.pushToast({ - title: window.i18n('invalidGroupName', window.CONSTANTS.MAX_GROUP_NAME_LENGTH), - type: 'error', - id: 'invalidGroupName', - }); + if ( + groupName.length === 0 || + groupName.length > window.CONSTANTS.MAX_GROUP_NAME_LENGTH + ) { + window.pushToast({ + title: window.i18n( + 'invalidGroupName', + window.CONSTANTS.MAX_GROUP_NAME_LENGTH + ), + type: 'error', + id: 'invalidGroupName', + }); return; } @@ -416,7 +421,10 @@ export class LeftPaneChannelSection extends React.Component { groupMembers.length >= window.CONSTANTS.SMALL_GROUP_SIZE_LIMIT ) { window.pushToast({ - title: window.i18n('invalidGroupSize', window.CONSTANTS.SMALL_GROUP_SIZE_LIMIT), + title: window.i18n( + 'invalidGroupSize', + window.CONSTANTS.SMALL_GROUP_SIZE_LIMIT + ), type: 'error', id: 'invalidGroupSize', }); diff --git a/ts/components/session/RegistrationTabs.tsx b/ts/components/session/RegistrationTabs.tsx index eee4c1a5e..f5ef06b68 100644 --- a/ts/components/session/RegistrationTabs.tsx +++ b/ts/components/session/RegistrationTabs.tsx @@ -585,6 +585,7 @@ export class RegistrationTabs extends React.Component<{}, State> { } = this.state; let enableContinue = true; + let text = window.i18n('continueYourSession'); const displayNameOK = !displayNameError && !!displayName; //display name required const mnemonicOK = !mnemonicError && !!mnemonicSeed; //Mnemonic required const passwordsOK = @@ -593,6 +594,7 @@ export class RegistrationTabs extends React.Component<{}, State> { enableContinue = displayNameOK && mnemonicOK && passwordsOK; } else if (signInMode === SignInMode.LinkingDevice) { enableContinue = !!primaryDevicePubKey; + text = window.i18n('linkDevice'); } else if (signUpMode === SignUpMode.EnterDetails) { enableContinue = displayNameOK && passwordsOK; } @@ -604,7 +606,7 @@ export class RegistrationTabs extends React.Component<{}, State> { }} buttonType={SessionButtonType.Brand} buttonColor={SessionButtonColor.Green} - text={window.i18n('continueYourSession')} + text={text} disabled={!enableContinue} /> );