Merge pull request #2107 from proddy/dev

dont show broken link if IMG cant be found
This commit is contained in:
Proddy
2024-10-17 14:04:19 +02:00
committed by GitHub
2 changed files with 9 additions and 3 deletions

View File

@@ -37,6 +37,7 @@ const Help = () => {
const [customSupportIMG, setCustomSupportIMG] = useState<string | null>(null);
const [customSupportHTML, setCustomSupportHTML] = useState<string | null>(null);
const [notFound, setNotFound] = useState<boolean>(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'
}
/>
</Stack>