Skip to content

Commit

Permalink
Merge branch 'yang_bam2_fix_multiple_run_without_reloading_completely'
Browse files Browse the repository at this point in the history
  • Loading branch information
anderspitman committed Oct 2, 2024
2 parents d3b9159 + ace3cd7 commit 7fa6c3a
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion home_page.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { commonCss } from './lib/iobio-charts/common.js';
import { commonCss, getDataBroker } from './lib/iobio-charts/common.js';
import { navigateTo } from './router.js';
import { URLInputModal } from './url_input_modal.js';
import { LocalFileInputModal } from './local_file_input_modal.js';
Expand Down Expand Up @@ -166,6 +166,8 @@ class HomePage extends HTMLElement {
this.attachShadow({ mode: 'open' });
this.shadowRoot.appendChild(homePageTemplate.content.cloneNode(true));
this.initDOMElements();

this.currentAlignmentUrl = null;
}

initDOMElements() {
Expand All @@ -178,6 +180,8 @@ class HomePage extends HTMLElement {
}

connectedCallback() {
this.broker = getDataBroker(this);

this.localFileButton.addEventListener('click', () => this.localFileInputModal.showModal());
// Handle the custom event from the local-file-input-modal
this.localFileInputModal.addEventListener('local-file-loaded', async (event) => this.handleLocalFileLoaded(event));
Expand Down Expand Up @@ -229,6 +233,12 @@ class HomePage extends HTMLElement {

// Navigate to the main content page with the URLs
navigateToMainContent(url1, url2) {
if (url1 !== this.currentAlignmentUrl) {
this.currentAlignmentUrl = url1;
// reset the state
this.broker.reset();
}

const queryParams = new URLSearchParams({
'alignment-url': url1,
});
Expand Down

0 comments on commit 7fa6c3a

Please sign in to comment.