Skip to content
This repository was archived by the owner on Apr 15, 2019. It is now read-only.

Commit

Permalink
Add authenticate step to encrypt/decrypt message
Browse files Browse the repository at this point in the history
... for locked account
  • Loading branch information
slaweet committed Nov 23, 2017
1 parent f205cf5 commit 77a5e75
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 7 deletions.
3 changes: 3 additions & 0 deletions i18n/locales/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@
"URL is invalid": "URL is invalid",
"Unable to connect to the node": "Unable to connect to the node",
"Undo": "Undo",
"Unlock account": "Unlock account",
"Update download finished": "Update download finished",
"Update now": "Update now",
"Updates downloaded, application has to be restarted to apply the updates.": "Updates downloaded, application has to be restarted to apply the updates.",
Expand Down Expand Up @@ -208,7 +209,9 @@
"confirmation": "confirmation",
"confirmations": "confirmations",
"decrypt": "decrypt",
"decrypt message": "decrypt message",
"encrypt": "encrypt",
"encrypt message": "encrypt message",
"logout": "logout",
"my votes": "my votes",
"send": "send",
Expand Down
2 changes: 1 addition & 1 deletion src/components/authenticate/authenticate.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class Authenticate extends React.Component {
onClick: this.props.closeDialog,
}}
primaryButton={{
label: this.props.t('Submit'),
label: this.props.t('Unlock account'),
onClick: this.update.bind(this),
className: 'authenticate-button',
disabled: (!authStateIsValid(this.state)),
Expand Down
8 changes: 5 additions & 3 deletions src/components/decryptMessage/decryptMessage.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ import React from 'react';
import Input from 'react-toolbox/lib/input';
import Lisk from 'lisk-js';
import { translate } from 'react-i18next';
import SignVerifyResult from '../signVerifyResult';
import ActionBar from '../actionBar';
import Authenticate from '../authenticate';
import SignVerifyResult from '../signVerifyResult';

class DecryptMessage extends React.Component {
constructor() {
Expand Down Expand Up @@ -53,7 +54,7 @@ class DecryptMessage extends React.Component {
}

render() {
return (
return (typeof this.props.account.passphrase === 'string' && this.props.account.passphrase.length > 0 ?
<div className='decrypt-message'>
<form onSubmit={this.showResult.bind(this)}>
<section>
Expand Down Expand Up @@ -87,7 +88,8 @@ class DecryptMessage extends React.Component {
}} />
}
</form>
</div>
</div> :
<Authenticate nextAction={this.props.t('decrypt message')}/>
);
}
}
Expand Down
8 changes: 5 additions & 3 deletions src/components/encryptMessage/encryptMessage.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ import React from 'react';
import Input from 'react-toolbox/lib/input';
import Lisk from 'lisk-js';
import { translate } from 'react-i18next';
import SignVerifyResult from '../signVerifyResult';
import ActionBar from '../actionBar';
import Authenticate from '../authenticate';
import SignVerifyResult from '../signVerifyResult';


class EncryptMessage extends React.Component {
Expand Down Expand Up @@ -67,7 +68,7 @@ class EncryptMessage extends React.Component {
}

render() {
return (
return (typeof this.props.account.passphrase === 'string' && this.props.account.passphrase.length > 0 ?
<div className='sign-message'>
<form onSubmit={this.encrypt.bind(this)}>
<section>
Expand Down Expand Up @@ -95,7 +96,8 @@ class EncryptMessage extends React.Component {
}} />
}
</form>
</div>
</div> :
<Authenticate nextAction={this.props.t('encrypt message')}/>
);
}
}
Expand Down

0 comments on commit 77a5e75

Please sign in to comment.