Skip to content

Commit

Permalink
iva: Minor code fixes managing hash fragments #TASK-7216 #TASK-7100
Browse files Browse the repository at this point in the history
  • Loading branch information
jmjuanes committed Nov 25, 2024
1 parent 11bac29 commit 5081c11
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/sites/iva/iva-app.js
Original file line number Diff line number Diff line change
Expand Up @@ -846,15 +846,15 @@ class IvaApp extends LitElement {
hashFragmentListener() {
console.log("HASH_LISTENER", window.location.hash);
this.app = null;
this.tool = "not-found";
this.tool = null;
// 0. in case of empty hash fragments, redirect to home tool
if (window.location.hash === "" || window.location.hash === "#") {
if (this.opencgaSession?.project?.id && this.opencgaSession?.study?.id) {
window.location.hash = `home/${this.opencgaSession.project.id}/${this.opencgaSession.study.id}`;
return;
}
}
const hashItems = window.location.hash.replace(/^#/, "").split("/");
const hashItems = window.location.hash.replace("#", "").split("/");
let hashApp = null, hashTool = null, hashProject = null, hashStudy = null, hashQuery = null;
// 1. check if the first hash fragment is an app
if (this.config?.apps?.length > 0 && this.config.apps.some(app => app.id === hashItems[0])) {
Expand Down Expand Up @@ -2222,7 +2222,6 @@ class IvaApp extends LitElement {
</div>
`;
break;
case "not-found":
default:
// TODO: check for extensions
// ExtensionsManager.getTools().map(tool => html`
Expand Down

0 comments on commit 5081c11

Please sign in to comment.