mirror of
https://github.com/hcengineering/platform.git
synced 2025-05-30 04:05:39 +00:00
Fix back to candidate with history (#975)
Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
parent
250937c175
commit
6b7f3a9f7b
@ -111,6 +111,8 @@ export const location = derived(locationWritable, (loc) => loc)
|
||||
|
||||
export function navigate (location: PlatformLocation): void {
|
||||
const url = locationToUrl(location)
|
||||
history.pushState(null, '', url)
|
||||
locationWritable.set(location)
|
||||
if (locationToUrl(getCurrentLocation()) !== url) {
|
||||
history.pushState(null, '', url)
|
||||
locationWritable.set(location)
|
||||
}
|
||||
}
|
||||
|
@ -17,7 +17,7 @@ location.subscribe((loc) => {
|
||||
if (loc.fragment !== currentLocation && loc.fragment !== undefined && loc.fragment.trim().length > 0) {
|
||||
const props = decodeURIComponent(loc.fragment).split('|')
|
||||
showPanel(props[0] as AnyComponent, props[1], props[2], 'full')
|
||||
} else if (loc.fragment === '' || (loc.fragment !== undefined && loc.fragment.trim().length === 0)) {
|
||||
} else if ((loc.fragment === undefined || (loc.fragment !== undefined && loc.fragment.trim().length === 0)) && currentLocation !== undefined) {
|
||||
closePanel()
|
||||
}
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user