Fallback logo on offline mode

This commit is contained in:
timothycarambat 2023-08-14 17:46:02 -07:00
parent 122f29069c
commit 9640eb7650

View File

@ -12,7 +12,9 @@ export default function useLogo() {
async function fetchInstanceLogo() {
try {
const logoURL = await System.fetchLogo(!prefersDarkMode);
setLogo(logoURL);
logoURL
? setLogo(logoURL)
: setLogo(prefersDarkMode ? AnythingLLMLight : AnythingLLMDark);
} catch (err) {
setLogo(prefersDarkMode ? AnythingLLMLight : AnythingLLMDark);
console.error("Failed to fetch logo:", err);