[mod] show img_load_error.svg if thumbnail fails to load (#6368)

* [mod] show img_load_error.svg if thumbnail fails to load (#6368)

Brave and a few other engines occasionally provide dead URLs for the thumbnails,
which looks pretty ugly in the UI.  As already with the image search, in case of
an error img_load_error.svg should be displayed here.

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>

* [build] /static (#6368)

---------

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
This commit is contained in:
Markus Heiser
2026-07-09 18:37:41 +02:00
committed by GitHub
parent b512eaa272
commit 8456831a04
7 changed files with 18 additions and 17 deletions

View File

@@ -35,8 +35,9 @@ const imageLoader = (resultElement: HTMLElement): void => {
}, 1000) as unknown as number;
};
const imageThumbnails: NodeListOf<HTMLImageElement> =
document.querySelectorAll<HTMLImageElement>("#urls img.image_thumbnail");
const imageThumbnails: NodeListOf<HTMLImageElement> = document.querySelectorAll<HTMLImageElement>(
"#urls img.image_thumbnail, img.thumbnail"
);
for (const thumbnail of imageThumbnails) {
if (thumbnail.complete && thumbnail.naturalWidth === 0) {
thumbnail.src = `${settings.theme_static_path}/img/img_load_error.svg`;