@plattar/plattar-qrcode 1.160.1 → 1.178.1

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.
@@ -151,11 +151,21 @@ class BaseElement extends HTMLElement {
151
151
 
152
152
  if (shortenURL && shortenURL.toLowerCase() === "true") {
153
153
  this._ShortenURL(url).then((newURL) => {
154
- this._GenerateQRCode(newURL, width, height);
154
+ // make sure by time promise is resolved that the original url hasn't been updated
155
+ const updatedURL = this.hasAttribute("url") ? this.getAttribute("url") : undefined;
156
+
157
+ if (updatedURL === url) {
158
+ this._GenerateQRCode(newURL, width, height);
159
+ }
155
160
  }).catch((_err) => {
156
161
  console.warn(_err);
157
162
  // ignore error and just generate normal QR Code
158
- this._GenerateQRCode(url, width, height);
163
+ // make sure by time promise is resolved that the original url hasn't been updated
164
+ const updatedURL = this.hasAttribute("url") ? this.getAttribute("url") : undefined;
165
+
166
+ if (updatedURL === url) {
167
+ this._GenerateQRCode(url, width, height);
168
+ }
159
169
  });
160
170
  }
161
171
  else {
@@ -168,7 +178,7 @@ class BaseElement extends HTMLElement {
168
178
  return;
169
179
  }
170
180
 
171
- const canvas = this._qrCode._canvas;
181
+ const canvas = this._qrCode._domCanvas || this._qrCode._canvas;
172
182
 
173
183
  if (canvas) {
174
184
  if (canvas.style.width !== "100%") {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plattar/plattar-qrcode",
3
- "version": "1.160.1",
3
+ "version": "1.178.1",
4
4
  "description": "Allows embedding Plattar-Style QR Codes for existing websites.",
5
5
  "main": "index.js",
6
6
  "module": "index.js",
@@ -43,9 +43,9 @@
43
43
  "object-hash": "^3.0.0"
44
44
  },
45
45
  "devDependencies": {
46
- "@babel/cli": "^7.21.0",
47
- "@babel/core": "^7.21.4",
48
- "@babel/preset-env": "^7.21.4",
46
+ "@babel/cli": "^7.23.4",
47
+ "@babel/core": "^7.23.7",
48
+ "@babel/preset-env": "^7.23.8",
49
49
  "browserify": "^17.0.0",
50
50
  "uglify-es": "^3.3.9"
51
51
  },
package/version.js CHANGED
@@ -1 +1 @@
1
- module.exports = "1.160.1";
1
+ module.exports = "1.178.1";