Skip to content

TagSpaces is an offline, open source, document manager with tagging support

fix: icon of broken thumbnail images

Ilian Sapundshiev2c160af0c67a
diff --git a/app/app.global.css b/app/app.global.css
index 5aede9040..e5f6837be 100644
--- a/app/app.global.css
+++ b/app/app.global.css
@@ -20,17 +20,3 @@ div[tabindex='-1']:focus {
.tagspaces-main-color {
color: #1dd19f;
}
-
-/* Fix for icon of broken thumbnails, disabled because does not work in list view */
-/* img[alt]:after {
- display: block;
- position: absolute;
- top: 0;
- left: 0;
- width: 100%;
- height: 100%;
- background-color: #fff;
- color: #fff;
- text-align: center;
- content: attr(alt);
-} */
diff --git a/app/perspectives/grid-perspective/components/CellContent.tsx b/app/perspectives/grid-perspective/components/CellContent.tsx
index 76b0b5d57..86f3bd8c8 100644
--- a/app/perspectives/grid-perspective/components/CellContent.tsx
+++ b/app/perspectives/grid-perspective/components/CellContent.tsx
@@ -134,6 +134,8 @@ const CellContent = (props: Props) => {
className={classes.gridCellThumb}
src={fsEntry.thumbPath}
// @ts-ignore
+ onError={i => (i.target.style.display = 'none')}
+ // @ts-ignore
loading="lazy"
style={{
objectFit: thumbnailMode,
@@ -318,6 +320,8 @@ const CellContent = (props: Props) => {
className={classes.gridCellThumb}
src={fsEntry.thumbPath}
// @ts-ignore
+ onError={i => (i.target.style.display = 'none')}
+ // @ts-ignore
loading="lazy"
style={{
objectFit: thumbnailMode,