From 0bf9d2fd5c7cb11bc63d5cf65a7b081c441e051f Mon Sep 17 00:00:00 2001 From: Colin Date: Thu, 2 Jan 2025 10:18:57 -0700 Subject: [PATCH] Misc --- products/jbrowse-web/src/SessionLoader.ts | 12 +++++------- products/jbrowse-web/src/components/Loader.tsx | 12 +++++++++++- products/jbrowse-web/src/loadHubSpec.ts | 4 ++-- 3 files changed, 18 insertions(+), 10 deletions(-) diff --git a/products/jbrowse-web/src/SessionLoader.ts b/products/jbrowse-web/src/SessionLoader.ts index 0abd15dde8..89e39f22c8 100644 --- a/products/jbrowse-web/src/SessionLoader.ts +++ b/products/jbrowse-web/src/SessionLoader.ts @@ -325,15 +325,13 @@ const SessionLoader = types async fetchConfig() { // @ts-expect-error const path = window.__jbrowseConfigPath - let { hubURL, configPath = path || 'config.json' } = self - console.log({ hubURL, configPath }) + const { hubURL, configPath = path || 'config.json' } = self if (!hubURL) { - // @ts-expect-error - if (window.__jbrowseCacheBuster) { - configPath += `?rand=${Math.random()}` - } const text = await openLocation({ - uri: configPath, + uri: + configPath + + // @ts-expect-error + (window.__jbrowseCacheBuster ? `?rand=${Math.random()}` : ''), locationType: 'UriLocation', }).readFile('utf8') const config = JSON.parse(text) diff --git a/products/jbrowse-web/src/components/Loader.tsx b/products/jbrowse-web/src/components/Loader.tsx index bf684240af..eb4607dab4 100644 --- a/products/jbrowse-web/src/components/Loader.tsx +++ b/products/jbrowse-web/src/components/Loader.tsx @@ -78,7 +78,17 @@ export function Loader({ setTrackList(undefined, 'replaceIn') setNav(undefined, 'replaceIn') setHighlight(undefined, 'replaceIn') - }, []) + }, [ + setAssembly, + setHighlight, + setHubURL, + setLoc, + setNav, + setPassword, + setSessionTracks, + setTrackList, + setTracks, + ]) return } diff --git a/products/jbrowse-web/src/loadHubSpec.ts b/products/jbrowse-web/src/loadHubSpec.ts index 1644cfcb76..8e2857d8fb 100644 --- a/products/jbrowse-web/src/loadHubSpec.ts +++ b/products/jbrowse-web/src/loadHubSpec.ts @@ -4,7 +4,7 @@ import type PluginManager from '@jbrowse/core/PluginManager' export async function loadHubSpec( { hubURL, - sessionTracks = [], + // sessionTracks = [], }: { hubURL: string[] sessionTracks: Record[] @@ -22,7 +22,7 @@ export async function loadHubSpec( // @ts-expect-error rootModel.setSession({ - name: `${hubURL.join(',')}`, + name: hubURL.join(','), sessionConnections: hubURL.map(r => ({ type: 'UCSCTrackHubConnection', connectionId: r,