Check for SSR failure

This commit is contained in:
Moris Zen
2018-07-10 01:27:20 +02:00
parent 8ec8311204
commit 09f7b48064
2 changed files with 21 additions and 23889 deletions

View File

@@ -28,7 +28,9 @@ export function getSwipeDirection(x1, x2, y1, y2) {
} }
export function isTouchDevice() { export function isTouchDevice() {
return 'ontouchstart' in document.documentElement if (typeof document !== 'undefined') {
return 'ontouchstart' in document.documentElement
}
} }
export function sortNumber(a, b) { export function sortNumber(a, b) {
@@ -36,9 +38,11 @@ export function sortNumber(a, b) {
} }
export function getScreenWidth() { export function getScreenWidth() {
return ( if (typeof document !== 'undefined') {
window.innerWidth || return (
document.documentElement.clientWidth || window.innerWidth ||
document.body.clientWidth document.documentElement.clientWidth ||
) document.body.clientWidth
)
}
} }

File diff suppressed because it is too large Load Diff