diff --git a/frontend/server.ts b/frontend/server.ts index 29677959d..ffce336f5 100644 --- a/frontend/server.ts +++ b/frontend/server.ts @@ -22,9 +22,10 @@ const win = domino.createWindow(template); win.__env = global.__env; // @ts-ignore -win.matchMedia = () => { +win.matchMedia = (media) => { return { - matches: true + media, + matches: true, }; }; diff --git a/frontend/src/app/shared/pipes/bytes-pipe/utils.ts b/frontend/src/app/shared/pipes/bytes-pipe/utils.ts index 7c88c83bc..138218a43 100644 --- a/frontend/src/app/shared/pipes/bytes-pipe/utils.ts +++ b/frontend/src/app/shared/pipes/bytes-pipe/utils.ts @@ -323,7 +323,7 @@ export function hasTouchScreen(): boolean { // @ts-ignore hasTouchScreen = navigator.msMaxTouchPoints > 0; } else { - const mQ = matchMedia?.('(pointer:coarse)'); + const mQ = window.matchMedia?.('(pointer:coarse)'); if (mQ?.media === '(pointer:coarse)') { hasTouchScreen = !!mQ.matches; } else if ('orientation' in window) {