Skip to content
Snippets Groups Projects
Commit 77c54ac1 authored by Xiao Gui's avatar Xiao Gui
Browse files

bugfix: set state from url

bugfix: properly find parcellation
parent f45ec234
No related branches found
No related tags found
No related merge requests found
......@@ -70,7 +70,7 @@ export class RouterService {
const stateFromRoute = cvtFullRouteToState(router.parseUrl(fullPath), state, (...e: any[]) => console.log(...e))
const routeFromState = cvtStateToHashedRoutes(state)
if ( fullPath !== routeFromState.join('/')) {
if ( fullPath !== `/${routeFromState.join('/')}`) {
store$.dispatch(
generalApplyState({
state: stateFromRoute
......
......@@ -80,7 +80,7 @@ function parseSearchParamForTemplateParcellationRegion(obj: TUrlPathObj, state:
if (!templateSelected) return null
const searchedId = decodeId(obj['p'])
const parcellationToLoad = templateSelected.parcellations.find(parcellation => parcellation['@id'] || parcellation['fullId'] === searchedId)
const parcellationToLoad = templateSelected.parcellations.find(parcellation => (parcellation['@id'] || parcellation['fullId']) === searchedId)
if (!parcellationToLoad) {
warnCb(`parcellation with id ${searchedId} not found... load the first parc instead`)
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment