From a67357d62aa48d0e57e526ed3cca565e9c37fc0d Mon Sep 17 00:00:00 2001 From: "ildar.timerbaev" Date: Thu, 5 Oct 2023 16:16:57 +0600 Subject: [PATCH] Fixed entry list item image fallback --- src/common/api/queries.ts | 2 +- .../entry-list-item-thumbnail.tsx | 17 +---------------- 2 files changed, 2 insertions(+), 17 deletions(-) diff --git a/src/common/api/queries.ts b/src/common/api/queries.ts index 60d103a96a4..0e87bd38c74 100644 --- a/src/common/api/queries.ts +++ b/src/common/api/queries.ts @@ -79,7 +79,7 @@ export function useImageDownloader( return (await blobToBase64(response.data)) as string; } catch (e) { - return ""; + return noImage; } }, { diff --git a/src/common/components/entry-list-item/entry-list-item-thumbnail.tsx b/src/common/components/entry-list-item/entry-list-item-thumbnail.tsx index 6037cc2a78c..7269813bd48 100644 --- a/src/common/components/entry-list-item/entry-list-item-thumbnail.tsx +++ b/src/common/components/entry-list-item/entry-list-item-thumbnail.tsx @@ -40,26 +40,11 @@ export function EntryListItemThumbnail({ entry, noImage, isCrossPost, entryProp, src={imgGrid} alt={isGridLoading ? "" : entry.title} style={{ width: imgGrid === noImage ? "172px" : "auto" }} - onError={(e: React.SyntheticEvent) => { - const target = e.target as HTMLImageElement; - target.src = global.isElectron - ? "./img/fallback.png" - : require("../../img/fallback.png"); - }} /> ) : ( - {isRowLoading { - const target = e.target as HTMLImageElement; - target.src = global.isElectron - ? "./img/fallback.png" - : require("../../img/fallback.png"); - }} - /> + {isRowLoading )}