diff --git a/src/components/Post.tsx b/src/components/Post.tsx index e48c17e..91e161e 100644 --- a/src/components/Post.tsx +++ b/src/components/Post.tsx @@ -569,7 +569,7 @@ export const AttachmentView = (props: AttachmentViewProps) => { src={`${uploads}/attachments/${props.attachment.id}/${props.attachment.filename}?preview`} alt={props.attachment.filename} title={props.attachment.filename} - height={Math.min(160, props.attachment.height)} // max-h-40 + height={Math.min(160, props.attachment.height ?? 0)} // max-h-40 /> diff --git a/src/lib/api/posts.ts b/src/lib/api/posts.ts index 0300936..7c70e60 100644 --- a/src/lib/api/posts.ts +++ b/src/lib/api/posts.ts @@ -9,11 +9,11 @@ import { USER_SCHEMA } from "./users"; export type Attachment = z.infer; const ATTACHMENT_SCHEMA = z.object({ filename: z.string(), - height: z.number(), + height: z.number().optional(), id: z.string(), mime: z.string(), size: z.number(), - width: z.number(), + width: z.number().optional(), }); type SchemaPost = z.infer & {