mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-10 00:27:41 +08:00
fix(ssr): fix global window and document references (#17590)
This commit is contained in:
@ -14,6 +14,9 @@ export function matchBreakpoint(win: Window, breakpoint: string | undefined) {
|
||||
if (breakpoint === undefined || breakpoint === '') {
|
||||
return true;
|
||||
}
|
||||
const mediaQuery = SIZE_TO_MEDIA[breakpoint];
|
||||
return win.matchMedia(mediaQuery).matches;
|
||||
if ((win as any).matchMedia) {
|
||||
const mediaQuery = SIZE_TO_MEDIA[breakpoint];
|
||||
return win.matchMedia(mediaQuery).matches;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user