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,17 +28,21 @@ export function getSwipeDirection(x1, x2, y1, y2) {
} }
export function isTouchDevice() { export function isTouchDevice() {
if (typeof document !== 'undefined') {
return 'ontouchstart' in document.documentElement return 'ontouchstart' in document.documentElement
} }
}
export function sortNumber(a, b) { export function sortNumber(a, b) {
return a - b return a - b
} }
export function getScreenWidth() { export function getScreenWidth() {
if (typeof document !== 'undefined') {
return ( return (
window.innerWidth || window.innerWidth ||
document.documentElement.clientWidth || document.documentElement.clientWidth ||
document.body.clientWidth document.body.clientWidth
) )
} }
}

File diff suppressed because it is too large Load Diff