File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change 1
- import { commonCss } from './lib/iobio-charts/common.js' ;
1
+ import { commonCss , getDataBroker } from './lib/iobio-charts/common.js' ;
2
2
import { navigateTo } from './router.js' ;
3
3
import { URLInputModal } from './url_input_modal.js' ;
4
4
import { LocalFileInputModal } from './local_file_input_modal.js' ;
@@ -166,6 +166,8 @@ class HomePage extends HTMLElement {
166
166
this . attachShadow ( { mode : 'open' } ) ;
167
167
this . shadowRoot . appendChild ( homePageTemplate . content . cloneNode ( true ) ) ;
168
168
this . initDOMElements ( ) ;
169
+
170
+ this . currentAlignmentUrl = null ;
169
171
}
170
172
171
173
initDOMElements ( ) {
@@ -178,6 +180,8 @@ class HomePage extends HTMLElement {
178
180
}
179
181
180
182
connectedCallback ( ) {
183
+ this . broker = getDataBroker ( this ) ;
184
+
181
185
this . localFileButton . addEventListener ( 'click' , ( ) => this . localFileInputModal . showModal ( ) ) ;
182
186
// Handle the custom event from the local-file-input-modal
183
187
this . localFileInputModal . addEventListener ( 'local-file-loaded' , async ( event ) => this . handleLocalFileLoaded ( event ) ) ;
@@ -229,6 +233,12 @@ class HomePage extends HTMLElement {
229
233
230
234
// Navigate to the main content page with the URLs
231
235
navigateToMainContent ( url1 , url2 ) {
236
+ if ( url1 !== this . currentAlignmentUrl ) {
237
+ this . currentAlignmentUrl = url1 ;
238
+ // reset the state
239
+ this . broker . reset ( ) ;
240
+ }
241
+
232
242
const queryParams = new URLSearchParams ( {
233
243
'alignment-url' : url1 ,
234
244
} ) ;
You can’t perform that action at this time.
0 commit comments