= ({
{
useEffect(() => {
// check whether the browser supports matchMedia API
- if (typeof window.matchMedia !== 'function') return
+ if (typeof globalThis.matchMedia !== 'function') return
- const mediaQuery = window.matchMedia(`(max-width: ${desktopViewMinWidth - 1}px)`)
+ const mediaQuery = globalThis.matchMedia(`(max-width: ${desktopViewMinWidth - 1}px)`)
const handleChange = (e: MediaQueryListEvent | MediaQueryList) => {
setIsMobile(e.matches)
diff --git a/frontend/src/server/fetchMetricsPDF.ts b/frontend/src/server/fetchMetricsPDF.ts
index 8cd3ee97d7..8b1a91cf7d 100644
--- a/frontend/src/server/fetchMetricsPDF.ts
+++ b/frontend/src/server/fetchMetricsPDF.ts
@@ -21,14 +21,14 @@ export const fetchMetricsPDF = async (path: string, fileName: string): Promise