diff --git a/web/src/components/MachineList.tsx b/web/src/components/MachineList.tsx index 9d6f2fb..3783977 100644 --- a/web/src/components/MachineList.tsx +++ b/web/src/components/MachineList.tsx @@ -182,9 +182,11 @@ export async function callServerPromise(result: Promise) { if ((x as { message: string })?.message !== undefined) { toast.success((x as { message: string }).message); } + return x; }) .catch((error) => { toast.error(error.message); + return null; }); } diff --git a/web/src/components/RunDisplay.tsx b/web/src/components/RunDisplay.tsx index f9b7704..3273035 100644 --- a/web/src/components/RunDisplay.tsx +++ b/web/src/components/RunDisplay.tsx @@ -1,6 +1,7 @@ "use client"; import { LiveStatus } from "./LiveStatus"; +import { callServerPromise } from "@/components/MachineList"; import { Dialog, DialogContent, @@ -28,7 +29,7 @@ export function RunDisplay({ className="appearance-none hover:cursor-pointer" onClick={async () => { if (view) return; - const _view = await getRunsOutputDisplay(run.id); + const _view = await callServerPromise(getRunsOutputDisplay(run.id)); setView(_view); }} > @@ -49,7 +50,7 @@ export function RunDisplay({ {/* */} - {view} +
{view}
); @@ -59,6 +60,7 @@ export function OutputRender(props: { run_id: string; filename: string }) { if (props.filename.endsWith(".png")) { return ( {props.filename}A list of your recent runs. */} - File + File Output @@ -42,7 +42,7 @@ export async function RunOutputs({ run_id }: { run_id: string }) { return ( Output - +