Skip to content
This repository has been archived by the owner on Dec 1, 2024. It is now read-only.

Commit

Permalink
Make the width and height optional to reflect uploads changes
Browse files Browse the repository at this point in the history
  • Loading branch information
mybearworld committed Nov 8, 2024
1 parent 94e101b commit 1ea5204
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/components/Post.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
/>
</button>
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/lib/api/posts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ import { USER_SCHEMA } from "./users";
export type Attachment = z.infer<typeof ATTACHMENT_SCHEMA>;
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<typeof BASE_POST_SCHEMA> & {
Expand Down

0 comments on commit 1ea5204

Please sign in to comment.