Added try catch to getUrlPreview

This commit is contained in:
ayes-web 2022-11-17 13:55:48 +02:00
parent 13c4e14762
commit 618602dc4f

View file

@ -423,9 +423,13 @@ function Embed({ link }) {
let unmounted = false;
async function getUrlPreview() {
try {
const info = await mx.getUrlPreview(link, 0);
if (unmounted) return;
setUrlPreviewInfo(info);
} catch {
setUrlPreviewInfo();
}
}
getUrlPreview();