From c448e7331f363db5a2bd120f4646975d184a5ebb Mon Sep 17 00:00:00 2001 From: Daniel Kaspo Date: Wed, 7 Jun 2017 20:19:36 -0400 Subject: [PATCH] Properly bound onChange handler for wallet decrypt. --- common/containers/Tabs/WalletDecrypt/index.jsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/common/containers/Tabs/WalletDecrypt/index.jsx b/common/containers/Tabs/WalletDecrypt/index.jsx index bcfaaf3b..b2e89241 100644 --- a/common/containers/Tabs/WalletDecrypt/index.jsx +++ b/common/containers/Tabs/WalletDecrypt/index.jsx @@ -44,6 +44,10 @@ export default class WalletDecrypt extends Component { constructor(props) { super(props); + // functions called by things like onChange need to be bound in this way. + // https://github.com/goatslacker/alt/issues/283#issuecomment-107463147 + this.handleDecryptionChoiceChange = this.handleDecryptionChoiceChange.bind(this); + this.state = { decryptionComponent: null }; @@ -59,7 +63,7 @@ export default class WalletDecrypt extends Component { type="radio" name="decryption-choice-radio-group" value={decryptionChoice.name} - onChange={this.handleDecryptionChoiceChange.bind(this)} + onChange={this.handleDecryptionChoiceChange} /> {translate(decryptionChoice.lid)}