Skip to content

Commit 1f835ef

Browse files
committed
refactor: QR code handler
1 parent 4d6122b commit 1f835ef

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/components/QRCode.vue

+2-1
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ const isReady = ref(false);
4848
4949
const qrCodeDataURL = ref<string | null>(null);
5050
51+
const reader = new FileReader();
52+
5153
const compute2 = async (
5254
urlToEncode = "",
5355
lighColor = "#ffffff",
@@ -88,7 +90,6 @@ const compute2 = async (
8890
8991
const data = (await qrCode.getRawData()) as Blob;
9092
// The above is a blob, we need to convert it to a data URL
91-
const reader = new FileReader();
9293
reader.readAsDataURL(data);
9394
reader.onload = () => {
9495
qrCodeDataURL.value = reader.result as string;

0 commit comments

Comments
 (0)