From 7141d745253f982f079822c5a8ba42aa39c7c45d Mon Sep 17 00:00:00 2001 From: Ishaan Dey Date: Mon, 13 May 2024 15:31:48 -0700 Subject: [PATCH] fix error states + remove run button --- backend/orchestrator/src/index.ts | 2 +- frontend/components/editor/index.tsx | 3 +-- frontend/components/editor/loading/index.tsx | 9 +++++++-- frontend/components/editor/sidebar/index.tsx | 4 ++-- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/backend/orchestrator/src/index.ts b/backend/orchestrator/src/index.ts index 1961d48..a9ef2d9 100644 --- a/backend/orchestrator/src/index.ts +++ b/backend/orchestrator/src/index.ts @@ -183,7 +183,7 @@ app.post("/start", async (req, res) => { res.status(200).send({ message: "Resources created." }) } catch (error: any) { const body = error.response.body - console.log("Failed to create resources", body) + console.log("Failed to create resources", error) if (body.code === 409) { return res.status(200).send({ message: "Resource already exists." }) diff --git a/frontend/components/editor/index.tsx b/frontend/components/editor/index.tsx index 87ba45b..0e7fd8b 100644 --- a/frontend/components/editor/index.tsx +++ b/frontend/components/editor/index.tsx @@ -19,7 +19,6 @@ export default function Editor({ userData: User; sandboxData: Sandbox; }) { - console.log("userData", userData); const [isServerRunning, setIsServerRunning] = useState(false); const [didFail, setDidFail] = useState(false); @@ -38,7 +37,7 @@ export default function Editor({ // }; }, []); - if (!isServerRunning) + if (!isServerRunning || didFail) return ; return ; diff --git a/frontend/components/editor/loading/index.tsx b/frontend/components/editor/loading/index.tsx index 79df06a..1cc84ac 100644 --- a/frontend/components/editor/loading/index.tsx +++ b/frontend/components/editor/loading/index.tsx @@ -39,7 +39,7 @@ export default function Loading({ {didFail ? ( <> Failed to - create resources. + start server. ) : ( <> @@ -47,7 +47,12 @@ export default function Loading({ )} - {description ? ( + {didFail ? ( + + Try again in a minute, or contact @ishaandey_ on Twitter/X if it + still doesn't work. + + ) : description ? ( {description} ) : null} diff --git a/frontend/components/editor/sidebar/index.tsx b/frontend/components/editor/sidebar/index.tsx index 6027012..a3a1065 100644 --- a/frontend/components/editor/sidebar/index.tsx +++ b/frontend/components/editor/sidebar/index.tsx @@ -200,9 +200,9 @@ export default function Sidebar({ - + */} );