fix error states + remove run button
This commit is contained in:
parent
9d5f9c37cc
commit
7141d74525
@ -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." })
|
||||
|
@ -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 <Loading didFail={didFail} text="Creating your sandbox resources" />;
|
||||
|
||||
return <CodeEditor userData={userData} sandboxData={sandboxData} />;
|
||||
|
@ -39,7 +39,7 @@ export default function Loading({
|
||||
{didFail ? (
|
||||
<>
|
||||
<X className="h-4 w-4 mr-2 text-destructive" /> Failed to
|
||||
create resources.
|
||||
start server.
|
||||
</>
|
||||
) : (
|
||||
<>
|
||||
@ -47,7 +47,12 @@ export default function Loading({
|
||||
</>
|
||||
)}
|
||||
</DialogTitle>
|
||||
{description ? (
|
||||
{didFail ? (
|
||||
<DialogDescription>
|
||||
Try again in a minute, or contact @ishaandey_ on Twitter/X if it
|
||||
still doesn't work.
|
||||
</DialogDescription>
|
||||
) : description ? (
|
||||
<DialogDescription>{description}</DialogDescription>
|
||||
) : null}
|
||||
</DialogHeader>
|
||||
|
@ -200,9 +200,9 @@ export default function Sidebar({
|
||||
</div>
|
||||
<Switch checked={ai} onCheckedChange={setAi} />
|
||||
</div>
|
||||
<Button className="w-full">
|
||||
{/* <Button className="w-full">
|
||||
<MonitorPlay className="w-4 h-4 mr-2" /> Run
|
||||
</Button>
|
||||
</Button> */}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
Loading…
x
Reference in New Issue
Block a user