aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--development/mock-dev.js21
-rw-r--r--mascara/src/app/first-time/confirm-seed-screen.js11
-rw-r--r--test/integration/lib/mascara-first-time.js3
3 files changed, 28 insertions, 7 deletions
diff --git a/development/mock-dev.js b/development/mock-dev.js
index a1fb3a86d..f332633d5 100644
--- a/development/mock-dev.js
+++ b/development/mock-dev.js
@@ -36,15 +36,28 @@ log.setLevel('debug')
//
const qs = require('qs')
-let queryString = qs.parse(window.location.href.split('#')[1])
-let selectedView = queryString.view || 'first time'
+const routerPath = window.location.href.split('#')[1]
+let queryString = {}
+let selectedView
+
+if (routerPath) {
+ queryString = qs.parse(routerPath.split('?')[1])
+}
+
+selectedView = queryString.view || 'first time'
const firstState = states[selectedView]
updateQueryParams(selectedView)
-function updateQueryParams(newView) {
+function updateQueryParams (newView) {
queryString.view = newView
const params = qs.stringify(queryString)
- window.location.href = window.location.href.split('#')[0] + `#${params}`
+ const locationPaths = window.location.href.split('#')
+ const routerPath = locationPaths[1] || ''
+ const newPath = locationPaths[0] + '#' + routerPath.split('?')[0] + `?${params}`
+
+ if (window.location.href !== newPath) {
+ window.location.href = newPath
+ }
}
//
diff --git a/mascara/src/app/first-time/confirm-seed-screen.js b/mascara/src/app/first-time/confirm-seed-screen.js
index 359e3d7fa..438f383b1 100644
--- a/mascara/src/app/first-time/confirm-seed-screen.js
+++ b/mascara/src/app/first-time/confirm-seed-screen.js
@@ -6,7 +6,7 @@ import classnames from 'classnames'
import shuffle from 'lodash.shuffle'
import { compose } from 'recompose'
import Identicon from '../../../../ui/app/components/identicon'
-import { confirmSeedWords } from '../../../../ui/app/actions'
+import { confirmSeedWords, showModal } from '../../../../ui/app/actions'
import Breadcrumbs from './breadcrumbs'
import LoadingScreen from './loading-screen'
import { DEFAULT_ROUTE } from '../../../../ui/app/routes'
@@ -18,6 +18,7 @@ class ConfirmSeedScreen extends Component {
seedWords: PropTypes.string,
confirmSeedWords: PropTypes.func,
history: PropTypes.object,
+ openBuyEtherModal: PropTypes.func,
};
static defaultProps = {
@@ -42,10 +43,13 @@ class ConfirmSeedScreen extends Component {
}
handleClick () {
- const { confirmSeedWords, history } = this.props
+ const { confirmSeedWords, history, openBuyEtherModal } = this.props
confirmSeedWords()
- .then(() => history.push(DEFAULT_ROUTE))
+ .then(() => {
+ history.push(DEFAULT_ROUTE)
+ openBuyEtherModal()
+ })
}
render () {
@@ -141,6 +145,7 @@ export default compose(
}),
dispatch => ({
confirmSeedWords: () => dispatch(confirmSeedWords()),
+ openBuyEtherModal: () => dispatch(showModal({ name: 'DEPOSIT_ETHER'})),
})
)
)(ConfirmSeedScreen)
diff --git a/test/integration/lib/mascara-first-time.js b/test/integration/lib/mascara-first-time.js
index 564852585..5e07ab0b4 100644
--- a/test/integration/lib/mascara-first-time.js
+++ b/test/integration/lib/mascara-first-time.js
@@ -13,6 +13,9 @@ async function runFirstTimeUsageTest (assert, done) {
await skipNotices(app)
+ const welcomeButton = (await findAsync(app, '.welcome-screen__button'))[0]
+ welcomeButton.click()
+
// Scroll through terms
const title = (await findAsync(app, '.create-password__title')).text()
assert.equal(title, 'Create Password', 'create password screen')