Skip to content

Commit 7fa6c3a

Browse files
committed
Merge branch 'yang_bam2_fix_multiple_run_without_reloading_completely'
2 parents d3b9159 + ace3cd7 commit 7fa6c3a

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

home_page.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { commonCss } from './lib/iobio-charts/common.js';
1+
import { commonCss, getDataBroker } from './lib/iobio-charts/common.js';
22
import { navigateTo } from './router.js';
33
import { URLInputModal } from './url_input_modal.js';
44
import { LocalFileInputModal } from './local_file_input_modal.js';
@@ -166,6 +166,8 @@ class HomePage extends HTMLElement {
166166
this.attachShadow({ mode: 'open' });
167167
this.shadowRoot.appendChild(homePageTemplate.content.cloneNode(true));
168168
this.initDOMElements();
169+
170+
this.currentAlignmentUrl = null;
169171
}
170172

171173
initDOMElements() {
@@ -178,6 +180,8 @@ class HomePage extends HTMLElement {
178180
}
179181

180182
connectedCallback() {
183+
this.broker = getDataBroker(this);
184+
181185
this.localFileButton.addEventListener('click', () => this.localFileInputModal.showModal());
182186
// Handle the custom event from the local-file-input-modal
183187
this.localFileInputModal.addEventListener('local-file-loaded', async (event) => this.handleLocalFileLoaded(event));
@@ -229,6 +233,12 @@ class HomePage extends HTMLElement {
229233

230234
// Navigate to the main content page with the URLs
231235
navigateToMainContent(url1, url2) {
236+
if (url1 !== this.currentAlignmentUrl) {
237+
this.currentAlignmentUrl = url1;
238+
// reset the state
239+
this.broker.reset();
240+
}
241+
232242
const queryParams = new URLSearchParams({
233243
'alignment-url': url1,
234244
});

0 commit comments

Comments
 (0)