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

Commit

Permalink
Change signMessage to sign message only on button click
Browse files Browse the repository at this point in the history
... not on input change
  • Loading branch information
slaweet committed Nov 17, 2017
1 parent a99af88 commit 700e87a
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/components/signMessage/signMessage.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class SignMessageComponent extends React.Component {
constructor() {
super();
this.state = {
message: '',
message: { value: '' },
result: '',
...authStatePrefill(),
};
Expand All @@ -39,12 +39,12 @@ class SignMessageComponent extends React.Component {
this.state.passphrase.value);
const result = Lisk.crypto.printSignedMessage(
message, signedMessage, this.props.account.publicKey);
this.setState({ result, resultIsShown: false, message });
this.setState({ result, resultIsShown: false });
}

showResult(event) {
event.preventDefault();
this.sign(this.state.message);
this.sign(this.state.message.value);
const copied = this.props.copyToClipboard(this.state.result, {
message: this.props.t('Press #{key} to copy'),
});
Expand All @@ -66,8 +66,8 @@ class SignMessageComponent extends React.Component {
<section>
<Input className='message' multiline label={this.props.t('Message')}
autoFocus={true}
value={this.state.message}
onChange={this.sign.bind(this)} />
value={this.state.message.value}
onChange={this.handleChange.bind(this, 'message')} />
<AuthInputs
passphrase={this.state.passphrase}
secondPassphrase={this.state.secondPassphrase}
Expand All @@ -83,7 +83,7 @@ class SignMessageComponent extends React.Component {
label: this.props.t('Sign and copy result to clipboard'),
className: 'sign-button',
type: 'submit',
disabled: (!this.state.result ||
disabled: (!this.state.message.value ||
this.state.resultIsShown ||
!authStateIsValid(this.state)),
}} />
Expand Down

0 comments on commit 700e87a

Please sign in to comment.