next-blurhash-previews 0.0.3-beta36 → 0.0.3-beta39

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -8,6 +8,7 @@ class ImageWithPreview extends HTMLElement {
8
8
 
9
9
  static observedAttributes = ["preview"];
10
10
 
11
+ #previewSet = false;
11
12
  get #imgEl(): any {
12
13
  return this.querySelector("img");
13
14
  }
@@ -59,6 +60,10 @@ class ImageWithPreview extends HTMLElement {
59
60
  }
60
61
 
61
62
  #updatePreview() {
63
+ if (this.#previewSet) {
64
+ return;
65
+ }
66
+ this.#previewSet = true;
62
67
  const previewObj = JSON.parse(this.getAttribute("preview")!);
63
68
  updateBlurHashPreview(this.#canvasEl, previewObj);
64
69
  }
@@ -6,6 +6,7 @@ class ImageWithPreview extends HTMLElement {
6
6
  sd;
7
7
  mo;
8
8
  static observedAttributes = ["preview"];
9
+ #previewSet = false;
9
10
  get #imgEl() {
10
11
  return this.querySelector("img");
11
12
  }
@@ -49,6 +50,10 @@ class ImageWithPreview extends HTMLElement {
49
50
  }
50
51
  }
51
52
  #updatePreview() {
53
+ if (this.#previewSet) {
54
+ return;
55
+ }
56
+ this.#previewSet = true;
52
57
  const previewObj = JSON.parse(this.getAttribute("preview"));
53
58
  updateBlurHashPreview(this.#canvasEl, previewObj);
54
59
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "next-blurhash-previews",
3
- "version": "0.0.3-beta36",
3
+ "version": "0.0.3-beta39",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "module": "index.js",