Fix search page breaking on initial load when logged in (#1781)
authorSleeplessOne1917 <abias1122@gmail.com>
Mon, 3 Jul 2023 20:43:52 +0000 (20:43 +0000)
committerGitHub <noreply@github.com>
Mon, 3 Jul 2023 20:43:52 +0000 (16:43 -0400)
Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
src/server/handlers/catch-all-handler.tsx

index c599e465fd0989025cd564a6ab097816ba94cf30..6b2149443fcfdff87f8f294518e291eb032f8687 100644 (file)
@@ -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