Route small images through in-memory receive instead of serialized disk chunk-acks, and improve gallery hydration for local copies and pending downloads so thumbnails display without minutes-long progress stalls. Co-authored-by: Cursor <cursoragent@cursor.com>
5 lines
267 B
TypeScript
5 lines
267 B
TypeScript
/** True when a resolved on-disk path contains bytes worth streaming to a peer. */
|
|
export function shouldServeAttachmentFromDiskPath(fileSize: number | null | undefined): boolean {
|
|
return typeof fileSize === 'number' && Number.isFinite(fileSize) && fileSize > 0;
|
|
}
|