fix build

This commit is contained in:
BennyKok 2024-01-18 22:52:01 +08:00
parent 8bc6655073
commit e88230997b

View File

@ -25,14 +25,16 @@ export async function RunInputs({
</TableHeader> </TableHeader>
<TableBody> <TableBody>
{Object.entries(run.workflow_inputs).map(([key, data]) => { {Object.entries(run.workflow_inputs).map(([key, data]) => {
let imageUrl; let imageUrl: string | undefined;
try { try {
if (data.startsWith("data:image/")) { if (typeof data === "string") {
imageUrl = data; if (data.startsWith("data:image/")) {
} else {
const url = new URL(data);
if (url.pathname.endsWith(".png")) {
imageUrl = data; imageUrl = data;
} else {
const url = new URL(data);
if (url.pathname.endsWith(".png")) {
imageUrl = data;
}
} }
} }
} catch (_) {} } catch (_) {}