Skip to content

Commit

Permalink
Created reset func in data broker
Browse files Browse the repository at this point in the history
  • Loading branch information
YangQi007 committed Oct 2, 2024
1 parent f2ac873 commit ace3cd7
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions 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 @@ -180,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 @@ -233,12 +235,8 @@ class HomePage extends HTMLElement {
navigateToMainContent(url1, url2) {
if (url1 !== this.currentAlignmentUrl) {
this.currentAlignmentUrl = url1;
this.dispatchEvent(new CustomEvent('toggle-loading-indicator-bamview',
{
bubbles: true,
composed: true
}
));
// reset the state
this.broker.reset();
}

const queryParams = new URLSearchParams({
Expand Down

0 comments on commit ace3cd7

Please sign in to comment.