From 3936ce64d4bd30194f0b1be4b2c89cdc466f12db Mon Sep 17 00:00:00 2001
From: Christoph Reiter <reiter.christoph@gmail.com>
Date: Wed, 21 Oct 2020 15:59:30 +0200
Subject: [PATCH] Always emit the code event

We need to give feedback to the user, so better let the user decide.
---
 packages/qr-code-scanner/README.md              | 2 +-
 packages/qr-code-scanner/src/qr-code-scanner.js | 3 +--
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/packages/qr-code-scanner/README.md b/packages/qr-code-scanner/README.md
index 08a10232..5d170424 100644
--- a/packages/qr-code-scanner/README.md
+++ b/packages/qr-code-scanner/README.md
@@ -21,7 +21,7 @@ With this camera device you can scan a QR code. If a QR code is detected a event
 
 - `lang` (optional, default: `de`): set to `de` or `en` for German or English
     - example `<dbp-qr-code-scanner lang="de"></dbp-qr-code-scanner>`
-- `match-regex` (optional, default: `'.*'`): a regular expression that when matching the QR code will result in the event being emitted and give feedback to the user
+- `match-regex` (optional, default: `'.*'`): a regular expression that when matching the QR code will result in the user getting feedback
 - `show-output` (optional, default: `false`): set to `true` for showing 
 a box under the video canvas with the read QR code data
     - example `<dbp-qr-code-scanner show-output></dbp-qr-code-scanner>`
diff --git a/packages/qr-code-scanner/src/qr-code-scanner.js b/packages/qr-code-scanner/src/qr-code-scanner.js
index 345ac46d..865b6f76 100644
--- a/packages/qr-code-scanner/src/qr-code-scanner.js
+++ b/packages/qr-code-scanner/src/qr-code-scanner.js
@@ -308,8 +308,7 @@ export class QrCodeScanner extends ScopedElementsMixin(DBPLitElement) {
                     outputMessage.hidden = true;
                     outputData.parentElement.hidden = false;
                     if (lastSentData !== code.data) {
-                        if (matched)
-                            that.sendUrl(code.data);
+                        that.sendUrl(code.data);
                         outputData.innerText = code.data;
                     }
                     lastSentData = code.data;
-- 
GitLab