diff --git a/_locales/en/messages.json b/_locales/en/messages.json index 07d5362f0..cf624c633 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -2110,10 +2110,16 @@ "message": "Please enter your password", "description": "Request for user to enter password to show seed." }, - "seedSavePrompt": { + "seedSavePromptMain": { + "message": "Please save the seed below in a safe location.", + "description": + "Prompt on seed modal requesting user to save their seed. Line one" + }, + "seedSavePromptAlt": { "message": - "Please save the seed below in a safe location. They can be used to restore your account if you lose access or migrate to a new device.", - "description": "Prompt on seed modal requesting user to save their seed" + "They can be used to restore your account if you lose access or migrate to a new device.", + "description": + "Prompt on seed modal requesting user to save their seed. Line two" }, "QRCodeTitle": { "message": "Your Public Key QRCode", diff --git a/ts/components/conversation/ConversationHeader.tsx b/ts/components/conversation/ConversationHeader.tsx index 06e3433c0..8174ef6c8 100644 --- a/ts/components/conversation/ConversationHeader.tsx +++ b/ts/components/conversation/ConversationHeader.tsx @@ -336,7 +336,7 @@ export class ConversationHeader extends React.Component { {this.renderBackButton()}
- {this.renderOptions(triggerId)} + {this.renderOptions()} {this.renderTitle()} {isPrivateGroup ? this.renderMemberCount() : null}
diff --git a/ts/components/session/SessionModal.tsx b/ts/components/session/SessionModal.tsx index 3a14421e6..d6502e163 100644 --- a/ts/components/session/SessionModal.tsx +++ b/ts/components/session/SessionModal.tsx @@ -92,9 +92,6 @@ export class SessionModal extends React.PureComponent { public onKeyUp(event: any) { switch (event.key) { - case 'Enter': - this.props.onOk(); - break; case 'Esc': case 'Escape': this.close(); diff --git a/ts/components/session/SessionSeedModal.tsx b/ts/components/session/SessionSeedModal.tsx index 621434254..7ba3350a9 100644 --- a/ts/components/session/SessionSeedModal.tsx +++ b/ts/components/session/SessionSeedModal.tsx @@ -35,6 +35,9 @@ export class SessionSeedModal extends React.Component { this.getSeed = this.getSeed.bind(this); this.confirmPassword = this.confirmPassword.bind(this); this.checkHasPassword = this.checkHasPassword.bind(this); + this.onEnter = this.onEnter.bind(this); + + window.addEventListener('keyup', this.onEnter); } public render() { @@ -44,7 +47,7 @@ export class SessionSeedModal extends React.Component { const maxPasswordLen = 64; this.checkHasPassword(); - this.getSeed(); + void this.getSeed(); const error = this.state.error; const hasPassword = this.state.hasPassword; @@ -53,13 +56,13 @@ export class SessionSeedModal extends React.Component { const loading = this.state.loadingPassword || this.state.loadingSeed; return ( - null} - onClose={onClose} - > + <> {!loading && ( - <> + null} + onClose={onClose} + >
{hasPassword && !passwordValid ? ( @@ -94,9 +97,13 @@ export class SessionSeedModal extends React.Component { <>

- {i18n('seedSavePrompt')} + {i18n('seedSavePromptMain')} +
+ + {i18n('seedSavePromptAlt')} +

-
+
{this.state.seed} @@ -116,9 +123,9 @@ export class SessionSeedModal extends React.Component {
)} - + )} - + ); } @@ -151,6 +158,8 @@ export class SessionSeedModal extends React.Component { error: '', }); + window.removeEventListener('keyup', this.onEnter); + return true; } @@ -172,7 +181,7 @@ export class SessionSeedModal extends React.Component { private async getSeed() { if (this.state.seed) { - return this.state.seed; + return false; } const manager = await window.getAccountManager(); @@ -183,7 +192,7 @@ export class SessionSeedModal extends React.Component { loadingSeed: false, }); - return seed; + return true; } private copySeed(seed: string) { @@ -195,4 +204,12 @@ export class SessionSeedModal extends React.Component { id: 'copySeedToast', }); } + + private onEnter(event: any) { + if (event.key === 'Enter') { + if ($('#seed-input-password').is(':focus')) { + this.confirmPassword(); + } + } + } } diff --git a/ts/components/session/SessionSettings.tsx b/ts/components/session/SessionSettings.tsx deleted file mode 100644 index eacd69b4c..000000000 --- a/ts/components/session/SessionSettings.tsx +++ /dev/null @@ -1,17 +0,0 @@ -import React from 'react'; - -interface Props { - i18n: any; -} - -export class SessionSettings extends React.Component { - constructor(props: any) { - super(props); - } - - public render() { - const i18n = this.props.i18n; - - return
; - } -}