diff --git a/src/components/common/Logo.tsx b/src/components/common/Logo.tsx index 54ad0d9..a862b46 100644 --- a/src/components/common/Logo.tsx +++ b/src/components/common/Logo.tsx @@ -4,7 +4,7 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { useEffect, useSyncExternalStore } from 'react'; +import { useEffect, useState, useSyncExternalStore } from 'react'; import { useTranslation } from 'react-i18next'; import inbuxaMark from '@/assets/inbuxa-mark.png'; @@ -63,10 +63,22 @@ export function DefaultLogo() { export default function Logo() { const { t } = useTranslation(); const logo = useSyncExternalStore(subscribeToLogo, getLogoState, getLogoState); + const [broken, setBroken] = useState(false); useEffect(loadLogoOnce, []); switch (logo.status) { case 'custom': - return {t('logo.alt',; + // A logo that loaded once can still fail later (its host goes away + // after the cache runs out); the inbuxa logo beats a broken image. + return broken ? ( + + ) : ( + {t('logo.alt', setBroken(true)} + /> + ); case 'loading': return