From a0cf54c0a05bdf7cca0da71eae54843d97583f5c Mon Sep 17 00:00:00 2001
From: SleeplessOne1917 <abias1122@gmail.com>
Date: Mon, 3 Jul 2023 20:43:52 +0000
Subject: [PATCH] Fix search page breaking on initial load when logged in
 (#1781)

Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
---
 src/server/handlers/catch-all-handler.tsx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/server/handlers/catch-all-handler.tsx b/src/server/handlers/catch-all-handler.tsx
index c599e46..6b21494 100644
--- a/src/server/handlers/catch-all-handler.tsx
+++ b/src/server/handlers/catch-all-handler.tsx
@@ -90,7 +90,7 @@ export default async (req: Request, res: Response) => {
     }
 
     const error = Object.values(routeData).find(
-      res => res.state === "failed"
+      res => res.state === "failed" && res.msg !== "couldnt_find_object" // TODO: find a better way of handling errors
     ) as FailedRequestState | undefined;
 
     // Redirect to the 404 if there's an API error
-- 
2.44.1