Skip to content

Commit

Permalink
Navigate without setting displayedRegion first
Browse files Browse the repository at this point in the history
  • Loading branch information
garrettjstevens committed Mar 19, 2021
1 parent e2594e3 commit 51d2b1d
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions products/jbrowse-react-linear-genome-view/src/createViewState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,16 +64,9 @@ export default function createViewState(opts: ViewStateOptions) {
stateTree.assemblyManager.allPossibleRefNames.length
) {
if (stateTree.session.view.initialized) {
if (!stateTree.session.view.displayedRegions.length) {
const assemblyState = stateTree.assemblyManager.assemblies[0]
const region =
assemblyState && assemblyState.regions && assemblyState.regions[0]
if (region) {
stateTree.session.view.setDisplayedRegions([getSnapshot(region)])
}
}
if (typeof location === 'string') {
stateTree.session.view.navToLocString(location)
const assemblyName = stateTree.assemblyManager.assemblies[0].name
stateTree.session.view.navToLocString(location, assemblyName)
} else {
stateTree.session.view.navTo(location)
}
Expand Down

0 comments on commit 51d2b1d

Please sign in to comment.