Skip to content

Commit

Permalink
chore - avoid throwing error during SSR ✨
Browse files Browse the repository at this point in the history
  • Loading branch information
willnguyen1312 committed Sep 4, 2024
1 parent ff9c940 commit 36f4fdf
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 28 deletions.
2 changes: 1 addition & 1 deletion packages/core/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export function enableScroll() {
}

export function getSourceImage(container: HTMLElement) {
if (!container) {
if (!container && typeof window !== "undefined") {
throw new Error("Please specify a container for the zoom image")
}

Expand Down
54 changes: 27 additions & 27 deletions size.json
Original file line number Diff line number Diff line change
@@ -1,53 +1,53 @@
{
"@zoom-image/core": {
"createZoomImageWheel": "2.1 KB",
"createZoomImageHover": "1.28 KB",
"createZoomImageMove": "1 KB",
"createZoomImageClick": "943 B",
"createZoomImageWheel": "2.11 KB",
"createZoomImageHover": "1.29 KB",
"createZoomImageMove": "1.01 KB",
"createZoomImageClick": "956 B",
"cropImage": "386 B",
"makeCalculateZoom": "171 B",
"makeCalculatePercentage": "153 B"
},
"@zoom-image/react": {
"useZoomImageWheel": "2.38 KB",
"useZoomImageHover": "1.56 KB",
"useZoomImageMove": "1.26 KB",
"useZoomImageClick": "1.18 KB"
"useZoomImageHover": "1.58 KB",
"useZoomImageMove": "1.27 KB",
"useZoomImageClick": "1.19 KB"
},
"@zoom-image/preact": {
"useZoomImageWheel": "3.27 KB",
"useZoomImageHover": "2.46 KB",
"useZoomImageWheel": "3.28 KB",
"useZoomImageHover": "2.47 KB",
"useZoomImageMove": "2.19 KB",
"useZoomImageClick": "2.11 KB"
},
"@zoom-image/qwik": {
"useZoomImageWheel": "2.51 KB",
"useZoomImageHover": "1.67 KB",
"useZoomImageMove": "1.37 KB",
"useZoomImageClick": "1.29 KB"
"useZoomImageWheel": "2.52 KB",
"useZoomImageHover": "1.68 KB",
"useZoomImageMove": "1.38 KB",
"useZoomImageClick": "1.3 KB"
},
"@zoom-image/solid": {
"useZoomImageWheel": "3.56 KB",
"useZoomImageHover": "2.75 KB",
"useZoomImageMove": "2.48 KB",
"useZoomImageClick": "2.4 KB"
"useZoomImageHover": "2.76 KB",
"useZoomImageMove": "2.49 KB",
"useZoomImageClick": "2.41 KB"
},
"@zoom-image/svelte": {
"useZoomImageWheel": "2.57 KB",
"useZoomImageHover": "1.75 KB",
"useZoomImageWheel": "2.58 KB",
"useZoomImageHover": "1.76 KB",
"useZoomImageMove": "1.48 KB",
"useZoomImageClick": "1.39 KB"
"useZoomImageClick": "1.41 KB"
},
"@zoom-image/vue": {
"useZoomImageWheel": "2.36 KB",
"useZoomImageHover": "1.54 KB",
"useZoomImageMove": "1.25 KB",
"useZoomImageClick": "1.17 KB"
"useZoomImageWheel": "2.37 KB",
"useZoomImageHover": "1.55 KB",
"useZoomImageMove": "1.26 KB",
"useZoomImageClick": "1.18 KB"
},
"@zoom-image/angular": {
"ZoomImageClickService": "3.97 KB",
"ZoomImageHoverService": "3.97 KB",
"ZoomImageMoveService": "3.97 KB",
"ZoomImageWheelService": "3.97 KB"
"ZoomImageClickService": "3.99 KB",
"ZoomImageHoverService": "3.99 KB",
"ZoomImageMoveService": "3.99 KB",
"ZoomImageWheelService": "3.99 KB"
}
}

0 comments on commit 36f4fdf

Please sign in to comment.