Fix typecheck

This commit is contained in:
Kamil Essekkat 2024-12-30 17:55:23 +01:00
parent 0fc30feaed
commit 38ec3f7502

View file

@ -119,7 +119,7 @@ export function useWifiQRCode({
async () => {
// @see https://github.com/zxing/zxing/wiki/Barcode-Contents#wi-fi-network-config-android-ios-11
// This is the full spec, there's quite a bit of logic to generate the string embeddedin the QR code.
text.value = getQrCodeText({
const qrText = getQrCodeText({
ssid: get(ssid),
password: get(password),
encryption: get(encryption),
@ -129,8 +129,8 @@ export function useWifiQRCode({
eapIdentity: get(eapIdentity),
eapPhase2Method: get(eapPhase2Method),
});
if (text.value) {
qrcode.value = await QRCode.toDataURL(get(text.value).trim(), {
if (qrText) {
qrcode.value = await QRCode.toDataURL(get(qrText).trim(), {
color: {
dark: get(foreground),
light: get(background),
@ -139,6 +139,7 @@ export function useWifiQRCode({
errorCorrectionLevel: 'M',
...options,
});
text.value = qrText;
}
},
{ immediate: true },