fix qr code web

This commit is contained in:
2025-10-24 14:48:30 +02:00
parent 8356b04eb2
commit 0b37c7bc07
4 changed files with 62 additions and 10 deletions
+6 -2
View File
@@ -13,7 +13,12 @@ const QrCode = ({
errorCorrectionLevel = "M",
}) => {
const { matrix } = useMemo(() => {
return generateQrMatrix({ value, errorCorrectionLevel });
try {
return generateQrMatrix({ value, errorCorrectionLevel });
} catch (error) {
console.error("qr.code.generate.error", error);
return { matrix: [] };
}
}, [value, errorCorrectionLevel]);
const cellSize = useMemo(() => {
@@ -58,4 +63,3 @@ const QrCode = ({
};
export default QrCode;