qr-secure-send 1.1.0 → 1.2.0

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.
@@ -4,7 +4,9 @@
4
4
  "Bash(git init:*)",
5
5
  "Bash(git add:*)",
6
6
  "Bash(git stash:*)",
7
- "Bash(chmod +x /Users/daviddayag/DEV/Personal/qr-secure-send/cli.js)"
7
+ "Bash(chmod +x /Users/daviddayag/DEV/Personal/qr-secure-send/cli.js)",
8
+ "Bash(git push:*)",
9
+ "Bash(npm publish:*)"
8
10
  ]
9
11
  }
10
12
  }
package/index.html CHANGED
@@ -788,8 +788,9 @@
788
788
  try {
789
789
  const codes = await detector.detect(video);
790
790
  if (codes.length > 0) {
791
- onResult(codes[0].rawValue);
792
- return; // stop scanning after first result
791
+ // onResult returns true if scan should stop (successful decode)
792
+ const shouldStop = await onResult(codes[0].rawValue);
793
+ if (shouldStop) return;
793
794
  }
794
795
  } catch (_) {}
795
796
  animId = requestAnimationFrame(scan);
@@ -947,7 +948,7 @@
947
948
  async (decodedText) => {
948
949
  if (!decodedText.startsWith("QRSEC:")) {
949
950
  errEl.textContent = "Not a QR Secure Send code.";
950
- return;
951
+ return false; // keep scanning
951
952
  }
952
953
  try {
953
954
  const secret = await decryptSecret(decodedText.slice(6), passphrase);
@@ -957,8 +958,10 @@
957
958
  QRScan.stop(region);
958
959
  document.getElementById("scan-btn").style.display = "block";
959
960
  document.getElementById("stop-btn").style.display = "none";
961
+ return true; // success, stop scanning
960
962
  } catch (e) {
961
963
  errEl.textContent = "Decryption failed. Wrong passphrase?";
964
+ return false; // keep scanning
962
965
  }
963
966
  },
964
967
  (msg) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qr-secure-send",
3
- "version": "1.1.0",
3
+ "version": "1.2.0",
4
4
  "description": "Encrypt and transfer secrets via QR code",
5
5
  "keywords": ["qr", "qrcode", "encryption", "password", "secure", "transfer"],
6
6
  "author": "",