Skip to content

Commit

Permalink
Fix mst snapshot failing to re-import if you refresh on the importfor…
Browse files Browse the repository at this point in the history
…m after returning to it
  • Loading branch information
cmdcolin committed Feb 17, 2021
1 parent f7e4894 commit 0e9e25d
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -709,7 +709,7 @@ exports[`<LinearGenomeView /> renders setup wizard 1`] = `
class="MuiGrid-root MuiGrid-item"
>
<button
class="MuiButtonBase-root MuiButton-root MuiButton-contained MuiButton-containedPrimary"
class="MuiButtonBase-root MuiButton-root MuiButton-contained makeStyles-button MuiButton-containedPrimary"
tabindex="0"
type="button"
>
Expand All @@ -722,6 +722,20 @@ exports[`<LinearGenomeView /> renders setup wizard 1`] = `
class="MuiTouchRipple-root"
/>
</button>
<button
class="MuiButtonBase-root MuiButton-root MuiButton-contained makeStyles-button MuiButton-containedSecondary"
tabindex="0"
type="button"
>
<span
class="MuiButton-label"
>
Show all regions in assembly
</span>
<span
class="MuiTouchRipple-root"
/>
</button>
</div>
</div>
</div>
Expand Down
5 changes: 5 additions & 0 deletions plugins/linear-genome-view/src/LinearGenomeView/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1137,6 +1137,11 @@ export function stateModelFactory(pluginManager: PluginManager) {
label: 'Return to import form',
onClick: () => {
self.setDisplayedRegions([])
// it is necessary to run these after setting displayed regions
// empty or else self.offsetPx gets set to infinity and breaks
// mobx-state-tree snapshot
self.scrollTo(0)
self.zoomTo(10)
},
icon: FolderOpenIcon,
},
Expand Down

0 comments on commit 0e9e25d

Please sign in to comment.