Skip to content

Commit 301584c

Browse files
committed
Indlæs fra filer
1 parent fc673cb commit 301584c

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

src/routes/auth/+page.svelte

+11-4
Original file line numberDiff line numberDiff line change
@@ -184,10 +184,17 @@
184184
console.log(`Error scanning file. Reason: ${err}`);
185185
});
186186
}
187-
function qrCodeUploaded(e) {
188-
e.preventDefault();
189-
e.stopPropagation();
190-
console.log(e);
187+
function qrCodeUploaded(element) {
188+
element.preventDefault();
189+
const html5QrCode = new Html5Qrcode('reader');
190+
191+
html5QrCode.scanFile(element.target.files[0], false)
192+
.then(qrCodeMessage => {
193+
qrUrl = qrCodeMessage;
194+
})
195+
.catch(err => {
196+
console.log(`Error scanning file. Reason: ${err}`);
197+
});
191198
}
192199
</script>
193200

0 commit comments

Comments
 (0)