Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 13 additions & 8 deletions packages/www/components/Sidebar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,16 +80,21 @@ const Sidebar = ({ id }: { id: SidebarId }) => {
const June = useJune();

useEffect(() => {
const handleRouteChange = (url, { shallow }) => {
if (June) June.page(url);
};
if (typeof June !== "undefined") {
const handleRouteChange = (url, { shallow }) => {
console.log("Tracking URL:", url);
June.track(url);
};

router.events.on("routeChangeStart", handleRouteChange);
console.log("Adding event listener");
router.events.on("routeChangeStart", handleRouteChange);

return () => {
router.events.off("routeChangeStart", handleRouteChange);
};
}, [June]);
return () => {
console.log("Removing event listener");
router.events.off("routeChangeStart", handleRouteChange);
};
}
}, [June, router.events]);

return (
<Box
Expand Down
3 changes: 0 additions & 3 deletions packages/www/components/StreamDetails/StreamHealthTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ const StreamHealthTab = ({ stream, streamHealth, invalidateStream }) => {
{ name: 0, "Session bitrate": 0 },
]);

const June = useJune();
const [multiDataChart, setMultiDataChart] = useState<MultistreamChartType[]>(
[]
);
Expand All @@ -35,8 +34,6 @@ const StreamHealthTab = ({ stream, streamHealth, invalidateStream }) => {

const [info, setInfo] = useState<StreamInfo | null>(null);

June?.track(events.stream.health);

const { getStreamInfo } = useApi();

const { query } = router;
Expand Down
1 change: 1 addition & 0 deletions packages/www/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@
"@types/isomorphic-fetch": "^0.0.35",
"@types/numeral": "^2.0.2",
"@types/react-table": "^7.0.5",
"@types/react-tooltip": "^4.2.4",
"@types/segment-analytics": "^0.0.32",
"@types/theme-ui": "0.3.1",
"@types/title": "^3.4.0",
Expand Down