From 085adbaffd8a23f25c85d25adb4deb980e541318 Mon Sep 17 00:00:00 2001 From: Jannis R Date: Mon, 12 Dec 2016 14:15:26 +0100 Subject: [PATCH 1/2] make showFirstRun in localStorage a bool --- js/src/views/Application/store.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/js/src/views/Application/store.js b/js/src/views/Application/store.js index bb42721cd..b9f960eff 100644 --- a/js/src/views/Application/store.js +++ b/js/src/views/Application/store.js @@ -16,14 +16,17 @@ import { action, observable } from 'mobx'; -const showFirstRun = window.localStorage.getItem('showFirstRun') !== '0'; - export default class Store { - @observable firstrunVisible = showFirstRun; + @observable firstrunVisible = false; constructor (api) { this._api = api; + const value = window.localStorage.getItem('showFirstRun'); + if (value) { + this.firstrunVisible = JSON.parse(value); + } + this._checkAccounts(); } @@ -33,7 +36,7 @@ export default class Store { @action toggleFirstrun = (visible = false) => { this.firstrunVisible = visible; - window.localStorage.setItem('showFirstRun', visible ? '1' : '0'); + window.localStorage.setItem('showFirstRun', JSON.stringify(!!visible)); } _checkAccounts () { From b980e7a3297b9bf8f5e01355bf6e6eb835dfed15 Mon Sep 17 00:00:00 2001 From: Jannis R Date: Mon, 12 Dec 2016 14:32:55 +0100 Subject: [PATCH 2/2] add skip button to first run modal --- js/src/modals/FirstRun/firstRun.js | 36 +++++++++++++++++++++++++----- 1 file changed, 31 insertions(+), 5 deletions(-) diff --git a/js/src/modals/FirstRun/firstRun.js b/js/src/modals/FirstRun/firstRun.js index a273d6e63..03bc8d770 100644 --- a/js/src/modals/FirstRun/firstRun.js +++ b/js/src/modals/FirstRun/firstRun.js @@ -15,6 +15,7 @@ // along with Parity. If not, see . import React, { Component, PropTypes } from 'react'; +import { connect } from 'react-redux'; import ActionDone from 'material-ui/svg-icons/action/done'; import ActionDoneAll from 'material-ui/svg-icons/action/done-all'; import NavigationArrowForward from 'material-ui/svg-icons/navigation/arrow-forward'; @@ -35,14 +36,15 @@ import ParityLogo from '../../../assets/images/parity-logo-black-no-text.svg'; const STAGE_NAMES = ['welcome', 'terms', 'new account', 'recovery', 'completed']; -export default class FirstRun extends Component { +class FirstRun extends Component { static contextTypes = { api: PropTypes.object.isRequired, store: PropTypes.object.isRequired } static propTypes = { - visible: PropTypes.bool, + hasAccounts: PropTypes.bool.isRequired, + visible: PropTypes.bool.isRequired, onClose: PropTypes.func.isRequired } @@ -109,6 +111,7 @@ export default class FirstRun extends Component { } renderDialogActions () { + const { hasAccounts } = this.props; const { canCreate, stage, hasAcceptedTnc } = this.state; switch (stage) { @@ -130,13 +133,26 @@ export default class FirstRun extends Component { ); case 2: - return ( + const buttons = [