message: Replaced component with key in wallet-decrypt state.
diff: @@ -7,7 +7,11 @@ import LedgerNanoSDecrypt from './LedgerNanoSDecrypt';
  import TrezorDecrypt from './TrezorDecrypt';
  import ViewOnlyDecrypt from './ViewOnlyDecrypt';
  -const decryptionChoices = [
  +export default class WalletDecrypt extends Component {
  + constructor(props) {
  + super(props);
  +
  + this.decryptionChoices = [
  {
  name: 'keystore-file',
  lid: 'x_Keystore2',
  @@ -40,21 +44,23 @@ const decryptionChoices = [
  }
  ];
  -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
  + decryptionChoice: this.decryptionChoices[0].name // auto-select first option.
  };
  }
  + getDecryptionComponent() {
  + const selectedDecryptionChoice = this.decryptionChoices.find((decryptionChoice) => {
  + return this.state.decryptionChoice === decryptionChoice.name;
  + });
  +
  + return selectedDecryptionChoice.component;
  + }
  +
  buildDecryptionChoices() {
  - return decryptionChoices.map((decryptionChoice, idx) => {
  + return this.decryptionChoices.map((decryptionChoice, idx) => {
  + const isSelected = this.state.decryptionChoice === decryptionChoice.name;
  +
  return (
  <label className="radio" key={decryptionChoice.name}>
  <input
  @@ -63,6 +69,7 @@ export default class WalletDecrypt extends Component {
  type="radio"
  name="decryption-choice-radio-group"
  value={decryptionChoice.name}
  + checked={isSelected}
  onChange={this.handleDecryptionChoiceChange}
  />
  <span id={`${decryptionChoice.name}-label`}>
  @@ -73,22 +80,20 @@ export default class WalletDecrypt extends Component {
  });
  }
  - handleDecryptionChoiceChange(event)
  - {
  - const choiceObject = decryptionChoices.find(decryptionChoice => {
  + handleDecryptionChoiceChange = (event) => {
  + const choiceObject = this.decryptionChoices.find(decryptionChoice => {
  return (decryptionChoice.name === event.target.value) ? decryptionChoice.component : false;
  });
  - const decryptionComponent = choiceObject.component;
  +
  + const decryptionChoice = choiceObject.name;
  this.setState({
  - decryptionComponent
  + decryptionChoice
  });
  }
  render() {
  - const decryptionComponent = this.state.decryptionComponent ?
  - <this.state.decryptionComponent /> :
  - null;
  + const DecryptionComponent = this.getDecryptionComponent();
  return (
  <section className="container">
  @@ -108,7 +113,7 @@ export default class WalletDecrypt extends Component {
  </section>
  - {decryptionComponent}
  + <DecryptionComponent />
  </article>
  </div>
  </article>
  