Skip to content
This repository was archived by the owner on Nov 6, 2020. It is now read-only.

Commit

Permalink
Fix disallowing paste of recovery phrase on first run, ref #6581
Browse files Browse the repository at this point in the history
  • Loading branch information
5chdn committed Sep 28, 2017
1 parent 7cc4389 commit e1bad40
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
5 changes: 5 additions & 0 deletions js/src/modals/CreateAccount/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export default class Store {
@observable gethAddresses = [];
@observable gethImported = [];
@observable isBusy = false;
@observable isTest = false;
@observable isWindowsPhrase = false;
@observable name = '';
@observable nameError = ERRORS.noName;
Expand Down Expand Up @@ -310,6 +311,10 @@ export default class Store {
this.stage--;
}

@action setIsTest = isTest => {
this.isTest = isTest;
}

createAccount = (vaultStore) => {
if (!this.canCreate) {
return false;
Expand Down
14 changes: 11 additions & 3 deletions js/src/modals/FirstRun/firstRun.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,16 +78,23 @@ class FirstRun extends Component {
hasAccounts: PropTypes.bool.isRequired,
newError: PropTypes.func.isRequired,
onClose: PropTypes.func.isRequired,
visible: PropTypes.bool.isRequired
visible: PropTypes.bool.isRequired,
isTest: PropTypes.bool.isRequired
}

createStore = new CreateStore(this.context.api, {}, true, false);
createStore = new CreateStore(this.context.api, {}, this.props.isTest, false);

state = {
stage: 0,
hasAcceptedTnc: false
}

componentWillReceiveProps (nextProps) {
if (nextProps.isTest !== this.props.isTest) {
this.createStore.setIsTest(nextProps.isTest);
}
}

render () {
const { visible } = this.props;
const { stage } = this.state;
Expand Down Expand Up @@ -348,9 +355,10 @@ class FirstRun extends Component {

function mapStateToProps (state) {
const { hasAccounts } = state.personal;
const { isTest } = state.nodeStatus;

return {
hasAccounts
hasAccounts, isTest
};
}

Expand Down
3 changes: 3 additions & 0 deletions js/src/modals/FirstRun/firstRun.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ function createRedux () {
return {
personal: {
hasAccounts: false
},
nodeStatus: {
isTest: false
}
};
}
Expand Down

0 comments on commit e1bad40

Please sign in to comment.