From 849610950f63b0be9be3e85d75008cb640bfdfe4 Mon Sep 17 00:00:00 2001 From: proddy Date: Thu, 17 Oct 2024 14:02:16 +0200 Subject: [PATCH] dont show broken link if IMG cant be found --- interface/src/app/main/Help.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/interface/src/app/main/Help.tsx b/interface/src/app/main/Help.tsx index 54cf68653..9c36096aa 100644 --- a/interface/src/app/main/Help.tsx +++ b/interface/src/app/main/Help.tsx @@ -37,6 +37,7 @@ const Help = () => { const [customSupportIMG, setCustomSupportIMG] = useState(null); const [customSupportHTML, setCustomSupportHTML] = useState(null); + const [notFound, setNotFound] = useState(false); useRequest(() => callAction({ action: 'customSupport' })).onSuccess((event) => { if (event && event.data && Object.keys(event.data).length !== 0) { @@ -102,7 +103,12 @@ const Help = () => { sx={{ maxHeight: { xs: 100, md: 250 } }} - src={customSupportIMG || 'https://emsesp.org/_media/images/installer.jpeg'} + onError={(e) => setNotFound(true)} + src={ + notFound + ? '' + : customSupportIMG || 'https://emsesp.org/_media/images/installer.jpeg' + } />