Skip to content

Commit

Permalink
Patch for Sentry error caused by slow image load as per laurenashpole…
Browse files Browse the repository at this point in the history
  • Loading branch information
edwh committed Oct 10, 2023
1 parent f0313f9 commit faf1498
Showing 1 changed file with 70 additions and 0 deletions.
70 changes: 70 additions & 0 deletions patches/vue-inner-image-zoom+2.0.0.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
diff --git a/node_modules/vue-inner-image-zoom/lib/vue-inner-image-zoom.common.js b/node_modules/vue-inner-image-zoom/lib/vue-inner-image-zoom.common.js
index 827cd61..6f66562 100644
--- a/node_modules/vue-inner-image-zoom/lib/vue-inner-image-zoom.common.js
+++ b/node_modules/vue-inner-image-zoom/lib/vue-inner-image-zoom.common.js
@@ -2235,17 +2235,19 @@ var es_object_to_string = __webpack_require__("d3b7");
}
},
handleLoad: function handleLoad(e) {
- var scaledDimensions = getScaledDimensions(e.target, this.zoomScale);
- this.imgProps.zoomImg = e.target;
- this.imgProps.zoomImg.setAttribute('width', scaledDimensions.width);
- this.imgProps.zoomImg.setAttribute('height', scaledDimensions.height);
- this.imgProps.scaledDimensions = scaledDimensions;
- this.imgProps.bounds = getBounds(this.$refs.img, false);
- this.imgProps.ratios = getRatios(this.imgProps.bounds, scaledDimensions);
-
- if (this.imgProps.onLoadCallback) {
- this.imgProps.onLoadCallback();
- this.imgProps.onLoadCallback = null;
+ if (this.$refs.img) {
+ var scaledDimensions = getScaledDimensions(e.target, this.zoomScale);
+ this.imgProps.zoomImg = e.target;
+ this.imgProps.zoomImg.setAttribute('width', scaledDimensions.width);
+ this.imgProps.zoomImg.setAttribute('height', scaledDimensions.height);
+ this.imgProps.scaledDimensions = scaledDimensions;
+ this.imgProps.bounds = getBounds(this.$refs.img, false);
+ this.imgProps.ratios = getRatios(this.imgProps.bounds, scaledDimensions);
+
+ if (this.imgProps.onLoadCallback) {
+ this.imgProps.onLoadCallback();
+ this.imgProps.onLoadCallback = null;
+ }
}
},
handleMouseMove: function handleMouseMove(e) {
diff --git a/node_modules/vue-inner-image-zoom/lib/vue-inner-image-zoom.umd.js b/node_modules/vue-inner-image-zoom/lib/vue-inner-image-zoom.umd.js
index ca86845..9ae51db 100644
--- a/node_modules/vue-inner-image-zoom/lib/vue-inner-image-zoom.umd.js
+++ b/node_modules/vue-inner-image-zoom/lib/vue-inner-image-zoom.umd.js
@@ -2244,17 +2244,19 @@ var es_object_to_string = __webpack_require__("d3b7");
}
},
handleLoad: function handleLoad(e) {
- var scaledDimensions = getScaledDimensions(e.target, this.zoomScale);
- this.imgProps.zoomImg = e.target;
- this.imgProps.zoomImg.setAttribute('width', scaledDimensions.width);
- this.imgProps.zoomImg.setAttribute('height', scaledDimensions.height);
- this.imgProps.scaledDimensions = scaledDimensions;
- this.imgProps.bounds = getBounds(this.$refs.img, false);
- this.imgProps.ratios = getRatios(this.imgProps.bounds, scaledDimensions);
-
- if (this.imgProps.onLoadCallback) {
- this.imgProps.onLoadCallback();
- this.imgProps.onLoadCallback = null;
+ if (this.$refs.img) {
+ var scaledDimensions = getScaledDimensions(e.target, this.zoomScale);
+ this.imgProps.zoomImg = e.target;
+ this.imgProps.zoomImg.setAttribute('width', scaledDimensions.width);
+ this.imgProps.zoomImg.setAttribute('height', scaledDimensions.height);
+ this.imgProps.scaledDimensions = scaledDimensions;
+ this.imgProps.bounds = getBounds(this.$refs.img, false);
+ this.imgProps.ratios = getRatios(this.imgProps.bounds, scaledDimensions);
+
+ if (this.imgProps.onLoadCallback) {
+ this.imgProps.onLoadCallback();
+ this.imgProps.onLoadCallback = null;
+ }
}
},
handleMouseMove: function handleMouseMove(e) {

0 comments on commit faf1498

Please sign in to comment.