Check for SSR failure
This commit is contained in:
@@ -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
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
23894
src/styles/index.css
23894
src/styles/index.css
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user