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 () => { async () => {
// @see https://github.com/zxing/zxing/wiki/Barcode-Contents#wi-fi-network-config-android-ios-11 // @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. // 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), ssid: get(ssid),
password: get(password), password: get(password),
encryption: get(encryption), encryption: get(encryption),
@ -129,8 +129,8 @@ export function useWifiQRCode({
eapIdentity: get(eapIdentity), eapIdentity: get(eapIdentity),
eapPhase2Method: get(eapPhase2Method), eapPhase2Method: get(eapPhase2Method),
}); });
if (text.value) { if (qrText) {
qrcode.value = await QRCode.toDataURL(get(text.value).trim(), { qrcode.value = await QRCode.toDataURL(get(qrText).trim(), {
color: { color: {
dark: get(foreground), dark: get(foreground),
light: get(background), light: get(background),
@ -139,6 +139,7 @@ export function useWifiQRCode({
errorCorrectionLevel: 'M', errorCorrectionLevel: 'M',
...options, ...options,
}); });
text.value = qrText;
} }
}, },
{ immediate: true }, { immediate: true },