From 5081c11e44414c486b79fd5197b1ebf7592e822f Mon Sep 17 00:00:00 2001 From: Josemi Date: Mon, 25 Nov 2024 18:56:18 +0100 Subject: [PATCH] iva: Minor code fixes managing hash fragments #TASK-7216 #TASK-7100 --- src/sites/iva/iva-app.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/sites/iva/iva-app.js b/src/sites/iva/iva-app.js index fef0b80b9..018d608e8 100644 --- a/src/sites/iva/iva-app.js +++ b/src/sites/iva/iva-app.js @@ -846,7 +846,7 @@ 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) { @@ -854,7 +854,7 @@ class IvaApp extends LitElement { 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])) { @@ -2222,7 +2222,6 @@ class IvaApp extends LitElement { `; break; - case "not-found": default: // TODO: check for extensions // ExtensionsManager.getTools().map(tool => html`