From 9640eb765018a28459bf32188a01ae38f7af7bdc Mon Sep 17 00:00:00 2001
From: timothycarambat <rambat1010@gmail.com>
Date: Mon, 14 Aug 2023 17:46:02 -0700
Subject: [PATCH] Fallback logo on offline mode

---
 frontend/src/hooks/useLogo.js | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/frontend/src/hooks/useLogo.js b/frontend/src/hooks/useLogo.js
index 36cd64d67..622e19b59 100644
--- a/frontend/src/hooks/useLogo.js
+++ b/frontend/src/hooks/useLogo.js
@@ -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);
-- 
GitLab