Check for SSR failure
This commit is contained in:
@@ -28,7 +28,9 @@ export function getSwipeDirection(x1, x2, y1, y2) {
|
||||
}
|
||||
|
||||
export function isTouchDevice() {
|
||||
return 'ontouchstart' in document.documentElement
|
||||
if (typeof document !== 'undefined') {
|
||||
return 'ontouchstart' in document.documentElement
|
||||
}
|
||||
}
|
||||
|
||||
export function sortNumber(a, b) {
|
||||
@@ -36,9 +38,11 @@ export function sortNumber(a, b) {
|
||||
}
|
||||
|
||||
export function getScreenWidth() {
|
||||
return (
|
||||
window.innerWidth ||
|
||||
document.documentElement.clientWidth ||
|
||||
document.body.clientWidth
|
||||
)
|
||||
if (typeof document !== 'undefined') {
|
||||
return (
|
||||
window.innerWidth ||
|
||||
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