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>
<TableBody>
{Object.entries(run.workflow_inputs).map(([key, data]) => {
let imageUrl;
let imageUrl: string | undefined;
try {
if (data.startsWith("data:image/")) {
imageUrl = data;
} else {
const url = new URL(data);
if (url.pathname.endsWith(".png")) {
if (typeof data === "string") {
if (data.startsWith("data:image/")) {
imageUrl = data;
} else {
const url = new URL(data);
if (url.pathname.endsWith(".png")) {
imageUrl = data;
}
}
}
} catch (_) {}