Fix going back when there's no state to pop

This commit is contained in:
6ea86b96 2017-05-22 19:58:33 +04:00
parent 720c0bac9f
commit 63dab7a496
No known key found for this signature in database
GPG key ID: B282D183E4931E8F

View file

@ -40,11 +40,14 @@ window.addEventListener('popstate', (event, param) => {
const pathParts = document.location.pathname.split('/') const pathParts = document.location.pathname.split('/')
const route = '/' + pathParts[pathParts.length - 1] const route = '/' + pathParts[pathParts.length - 1]
if (route.match(/html$/)) return let action
if (route.match(/html$/)) {
action = doChangePath('/discover')
} else {
action = doChangePath(`${route}${queryString}`)
}
console.log('title should be set here, but it is not in popstate? TODO') app.store.dispatch(action)
app.store.dispatch(doChangePath(`${route}${queryString}`))
}) })
ipcRenderer.on('open-uri-requested', (event, uri) => { ipcRenderer.on('open-uri-requested', (event, uri) => {