Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
ensembl-web
ensembl-client
Commits
e6ea1356
Unverified
Commit
e6ea1356
authored
Apr 13, 2021
by
Andrey Azov
Committed by
GitHub
Apr 13, 2021
Browse files
Fix browser back button behaviour on genome browser page interstitial (#489)
parent
68144640
Pipeline
#149465
passed with stages
in 6 minutes and 32 seconds
Changes
1
Pipelines
4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
3 deletions
+13
-3
src/ensembl/src/content/app/browser/hooks/useBrowserRouting.ts
...nsembl/src/content/app/browser/hooks/useBrowserRouting.ts
+13
-3
No files found.
src/ensembl/src/content/app/browser/hooks/useBrowserRouting.ts
View file @
e6ea1356
...
...
@@ -149,15 +149,25 @@ const useBrowserRouting = () => {
?
buildFocusIdForUrl
(
activeEnsObjectId
)
:
null
;
const
p
arams
=
{
const
nextUrlP
arams
=
{
genomeId
,
focus
:
focusIdForUrl
,
location
:
chrLocation
?
getChrLocationStr
(
chrLocation
)
:
null
};
dispatch
(
push
(
urlFor
.
browser
(
params
)));
// In case the url is simply /genome-browser, use the `replace` history method to redirect the user further.
// This will allow the user to return from the next page (genome browser with genome id selected)
// back to the page from which they have navigated to the current one. If the `push` method is used,
// the user will not be able to get back past this page, because the url without genome id will remain
// in the history, and the user will be forcefully redirected to the url with the genome id.
//
// NOTE: the logic will likely change in the future when /genome-browser without the selected genome id
// becomes a valid searchable page in its own right.
const
historyMethod
=
params
.
genomeId
?
push
:
replace
;
dispatch
(
historyMethod
(
urlFor
.
browser
(
nextUrlParams
)));
},
[
genomeId
]
[
params
.
genomeId
]
);
return
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment