Run prettier

This commit is contained in:
Johannes Marbach
2024-09-02 08:44:33 +02:00
parent 5b09a5ebd8
commit 8655b41c05

View File

@@ -32,23 +32,26 @@ export const QrCode: FC<Props> = ({ data, className }) => {
useEffect(() => { useEffect(() => {
let isCancelled = false; let isCancelled = false;
toDataURL(data, { errorCorrectionLevel: "L" }).then((url) => { toDataURL(data, { errorCorrectionLevel: "L" })
.then((url) => {
if (!isCancelled) { if (!isCancelled) {
setUrl(url); setUrl(url);
} }
}).catch((reason) => { })
.catch((reason) => {
if (!isCancelled) { if (!isCancelled) {
setUrl(null); setUrl(null);
} }
}); });
return (): void => { isCancelled = true; }; return (): void => {
isCancelled = true;
};
}, [data]); }, [data]);
return ( return (
<div className={classNames(styles.qrCode, className)}> <div className={classNames(styles.qrCode, className)}>
{url && <img src={url} alt={t("qr_code")} />} {url && <img src={url} alt={t("qr_code")} />}
</div> </div>
); );
}; };