@@ -715,7 +715,11 @@ const syncTopTabToUrl = (tabId: GuideTopTab) => {
|
||||
if (typeof window === 'undefined') return
|
||||
if (!isIndexHashRoute()) return
|
||||
|
||||
const url = `#/pages/index/index?tab=${tabId}`
|
||||
const currentHash = window.location.hash || ''
|
||||
const queryStart = currentHash.indexOf('?')
|
||||
const params = new URLSearchParams(queryStart >= 0 ? currentHash.slice(queryStart + 1) : '')
|
||||
params.set('tab', tabId)
|
||||
const url = `#/pages/index/index?${params.toString()}`
|
||||
if (window.location.hash !== url) {
|
||||
window.history.replaceState(window.history.state, '', url)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user