Skip to content

Commit

Permalink
chore(client): debug logging
Browse files Browse the repository at this point in the history
  • Loading branch information
davidlougheed committed Jan 18, 2024
1 parent a8dedff commit bf00516
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
10 changes: 6 additions & 4 deletions client/src/components/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,13 @@ const RoutedApp = () => {
return;
}
if (chrom && position) {
console.debug("navigate explore - have URL-encoded node, chrom, and position", urlEncodedNode, chrom, position);
navigate(`/datasets/${urlEncodedNode}/explore/locus/${chrom}/${position}`);
const url = `/datasets/${urlEncodedNode}/explore/locus/${chrom}/${position}`;
console.debug("navigate explore - have URL-encoded node, chrom, and position", url);
navigate(url);
} else {
console.debug("navigate explore - have URL-encoded node only", urlEncodedNode);
navigate(`/datasets/${urlEncodedNode}/explore`);
const url = `/datasets/${urlEncodedNode}/explore`;
console.debug("navigate explore - have URL-encoded node only", url);
navigate(url);
}
}, [location.pathname, urlEncodedNode, chrom, position, navigate]);
const navigateFAQ = () => navigate("/faq");
Expand Down
10 changes: 7 additions & 3 deletions client/src/components/PeakResults.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,14 @@ const PeakResults = () => {

if (activeAssay && !(activeAssay in peaksByAssay) && peaksLoaded) {
// Assay isn't valid for the position in question
navigate(`/datasets/${node}/explore/locus/${chrom}/${position}` +
(assaysWithFeatures.length ? `/${assays[0]}` : ""), {replace: true});
const url = `/datasets/${node}/explore/locus/${chrom}/${position}` +
(assaysWithFeatures.length ? `/${assays[0]}` : "");
console.info(`assay ${activeAssay} isn't valid for the locus in question; navigating to ${url}`);
navigate(url, {replace: true});
} else if (!activeAssay && assaysWithFeatures.length && peaksLoaded) {
navigate(`/datasets/${node}/explore/locus/${chrom}/${position}/${assaysWithFeatures[0]}`, {replace: true});
const url = `/datasets/${node}/explore/locus/${chrom}/${position}/${assaysWithFeatures[0]}`;
console.info(`no assay selected; navigating to ${url}`);
navigate(url, {replace: true});
}
}, [activeAssay, chrom, position, peaksLoaded]);

Expand Down

0 comments on commit bf00516

Please sign in to comment.