Skip to content

Commit

Permalink
Fixed bug causing start end values to reset when contig id is passed …
Browse files Browse the repository at this point in the history
…as url param
  • Loading branch information
MGS-sails committed Feb 2, 2024
1 parent 84b42c4 commit 88f91fc
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/utils/igvBrowserHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ export const updateLocusQueryParams = (
) => {
const currentUrl = new URL(window.location.href);
const contigId = currentUrl.searchParams.get('contig_id');
console.log('start', start);

Check warning on line 17 in src/utils/igvBrowserHelper.ts

View workflow job for this annotation

GitHub Actions / test

Unexpected console statement

Check warning on line 17 in src/utils/igvBrowserHelper.ts

View workflow job for this annotation

GitHub Actions / test

Unexpected console statement
console.log('end', end);

Check warning on line 18 in src/utils/igvBrowserHelper.ts

View workflow job for this annotation

GitHub Actions / test

Unexpected console statement

Check warning on line 18 in src/utils/igvBrowserHelper.ts

View workflow job for this annotation

GitHub Actions / test

Unexpected console statement
if (contigId) {
currentUrl.searchParams.set('contig_id', locusSearchString);
currentUrl.searchParams.set('start', start);
Expand All @@ -32,14 +34,16 @@ export const resolveQueryParameters = (browser: Browser) => {
const currentUrl = new URL(window.location.href);
const featureId = currentUrl.searchParams.get('feature-id');
const contigId = currentUrl.searchParams.get('contig_id');
const start = currentUrl.searchParams.get('start');
const end = currentUrl.searchParams.get('end');
const selectedTrackColor = currentUrl.searchParams.get(
'functional-annotation'
);
if (featureId) {
browser.search(featureId);
}
if (contigId) {
browser.search(contigId);
browser.search(`${contigId}:${start}-${end}`);
}
return {
featureId,
Expand All @@ -56,6 +60,7 @@ export const handleLocusChanges = (
}
) => {
browser.on('locuschange', (referenceFrame) => {
console.log('referenceFrame[0]', referenceFrame);

Check warning on line 63 in src/utils/igvBrowserHelper.ts

View workflow job for this annotation

GitHub Actions / test

Unexpected console statement

Check warning on line 63 in src/utils/igvBrowserHelper.ts

View workflow job for this annotation

GitHub Actions / test

Unexpected console statement
const { locusSearchString, start, end } = referenceFrame[0];
updateLocusQueryParams(locusSearchString, start, end);
});
Expand Down

0 comments on commit 88f91fc

Please sign in to comment.