A couple of minor history fixes
This commit is contained in:
parent
d2c97d3460
commit
3085b2d362
2 changed files with 9 additions and 8 deletions
|
@ -22,19 +22,18 @@ const queryStringFromParams = (params) => {
|
|||
.join('&')
|
||||
}
|
||||
|
||||
export function doNavigate(path, params) {
|
||||
export function doNavigate(path, params = {}) {
|
||||
return function(dispatch, getState) {
|
||||
const state = getState()
|
||||
const pageTitle = selectPageTitle(state)
|
||||
let url = path
|
||||
if (params)
|
||||
url = `${url}?${queryStringFromParams(params)}`
|
||||
|
||||
history.pushState(params, pageTitle, url)
|
||||
|
||||
window.document.title = pageTitle
|
||||
|
||||
dispatch(doChangePath(url))
|
||||
|
||||
const state = getState()
|
||||
const pageTitle = selectPageTitle(state)
|
||||
history.pushState(params, pageTitle, url)
|
||||
window.document.title = pageTitle
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -46,6 +45,7 @@ export function doChangePath(path) {
|
|||
path,
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import {createSelector} from 'reselect'
|
||||
import lbryuri from 'lbryuri'
|
||||
import {
|
||||
selectIsSearching,
|
||||
selectSearchActivated,
|
||||
|
@ -62,7 +63,7 @@ export const selectPageTitle = createSelector(
|
|||
case 'rewards':
|
||||
return page.charAt(0).toUpperCase() + page.slice(1)
|
||||
case 'show':
|
||||
return lbryuri.normalize(page)
|
||||
return lbryuri.normalize(uri)
|
||||
case 'downloaded':
|
||||
return 'Downloads & Purchases'
|
||||
case 'published':
|
||||
|
|
Loading…
Add table
Reference in a new issue