Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
siibra-explorer
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Xiao Gui
siibra-explorer
Commits
21477de5
Commit
21477de5
authored
4 years ago
by
Xiao Gui
Browse files
Options
Downloads
Patches
Plain Diff
bugfix: select latest base layer when select atlas
parent
ddbabded
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/state/effects/viewerState.useEffect.ts
+13
-5
13 additions, 5 deletions
src/state/effects/viewerState.useEffect.ts
with
13 additions
and
5 deletions
src/state/effects/viewerState.useEffect.ts
+
13
−
5
View file @
21477de5
...
...
@@ -117,10 +117,18 @@ export class ViewerStateControllerUseEffect implements OnDestroy {
const
templateSpaceId
=
templateTobeSelected
[
'
@id
'
]
const
parcellationId
=
(
templateTobeSelected
.
availableIn
.
find
(
p
=>
!!
p
.
baseLayer
)
||
templateTobeSelected
.
availableIn
[
0
]
)[
'
@id
'
]
const
atlasTmpl
=
atlas
.
templateSpaces
.
find
(
t
=>
t
[
'
@id
'
]
===
templateSpaceId
)
const
atlasParcs
=
atlasTmpl
.
availableIn
.
map
(
availP
=>
atlas
.
parcellations
.
find
(
p
=>
availP
[
'
@id
'
]
===
p
[
'
@id
'
]))
.
filter
(
fullP
=>
!!
fullP
)
const
atlasParc
=
atlasParcs
.
find
(
p
=>
{
if
(
!
p
.
baseLayer
)
return
false
if
(
p
[
'
@version
'
])
{
return
!
p
[
'
@version
'
][
'
@next
'
]
}
return
true
})
const
parcellationId
=
atlasParc
&&
atlasParc
[
'
@id
'
]
const
templateSelected
=
fetchedTemplates
.
find
(
t
=>
templateSpaceId
===
t
[
'
@id
'
])
if
(
!
templateSelected
)
{
...
...
@@ -128,7 +136,7 @@ export class ViewerStateControllerUseEffect implements OnDestroy {
message
:
CONST
.
TEMPLATE_NOT_FOUND
})
}
const
parcellationSelected
=
templateSelected
.
parcellations
.
find
(
p
=>
p
[
'
@id
'
]
===
parcellationId
)
const
parcellationSelected
=
parcellationId
&&
templateSelected
.
parcellations
.
find
(
p
=>
p
[
'
@id
'
]
===
parcellationId
)
return
viewerStateNewViewer
({
selectTemplate
:
templateSelected
,
selectParcellation
:
parcellationSelected
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment