Web: Common/Components: added checkIsSSR to utils, applied changes

This commit is contained in:
Artem Tarasov 2022-08-17 11:19:49 +03:00
parent 95e97ac8ed
commit 46ca8055f2
2 changed files with 9 additions and 1 deletions

View File

@ -402,3 +402,7 @@ export function getOAuthToken(tokenGetterWin) {
export function getLoginLink(token, code) {
return combineUrl(proxyURL, `/login.ashx?p=${token}&code=${code}`);
}
export function checkIsSSR() {
return typeof window === "undefined";
}

View File

@ -1,3 +1,5 @@
import { checkIsSSR } from "@docspace/common/utils";
export const size = {
mobile: 375,
hugeMobile: 428,
@ -35,7 +37,9 @@ export const isTablet = () => {
};
export const isDesktop = () => {
return window.innerWidth >= size.desktop;
if (!checkIsSSR()) {
return window.innerWidth >= size.desktop;
} else return false;
};
export const isTouchDevice = !!(