Run prettier
This commit is contained in:
@@ -32,17 +32,21 @@ 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 (
|
||||||
@@ -51,4 +55,3 @@ export const QrCode: FC<Props> = ({ data, className }) => {
|
|||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user