diff --git a/js/src/modals/CreateAccount/store.js b/js/src/modals/CreateAccount/store.js index cc2160ab95c..cab221f4e4e 100644 --- a/js/src/modals/CreateAccount/store.js +++ b/js/src/modals/CreateAccount/store.js @@ -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; @@ -310,6 +311,10 @@ export default class Store { this.stage--; } + @action setIsTest = isTest => { + this.isTest = isTest; + } + createAccount = (vaultStore) => { if (!this.canCreate) { return false; diff --git a/js/src/modals/FirstRun/firstRun.js b/js/src/modals/FirstRun/firstRun.js index 2db94fdb9b6..ea91fa83db7 100644 --- a/js/src/modals/FirstRun/firstRun.js +++ b/js/src/modals/FirstRun/firstRun.js @@ -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; @@ -348,9 +355,10 @@ class FirstRun extends Component { function mapStateToProps (state) { const { hasAccounts } = state.personal; + const { isTest } = state.nodeStatus; return { - hasAccounts + hasAccounts, isTest }; } diff --git a/js/src/modals/FirstRun/firstRun.spec.js b/js/src/modals/FirstRun/firstRun.spec.js index 14707dd5caf..3af7aaabb05 100644 --- a/js/src/modals/FirstRun/firstRun.spec.js +++ b/js/src/modals/FirstRun/firstRun.spec.js @@ -35,6 +35,9 @@ function createRedux () { return { personal: { hasAccounts: false + }, + nodeStatus: { + isTest: false } }; }