(rows: QueuedAttachment[])
| 103 | } |
| 104 | |
| 105 | export function selectReadyBlocks(rows: QueuedAttachment[]): AttachmentBlock[] { |
| 106 | return rows |
| 107 | .filter( |
| 108 | (r): r is QueuedAttachment & { attachmentId: string } => |
| 109 | r.status === 'ready' && typeof r.attachmentId === 'string' |
| 110 | ) |
| 111 | .map(r => ({ |
| 112 | type: 'attachment' as const, |
| 113 | attachmentId: r.attachmentId, |
| 114 | mimeType: r.mimeType, |
| 115 | size: r.size, |
| 116 | filename: r.filename, |
| 117 | })); |
| 118 | } |
| 119 | |
| 120 | export function selectIsUploading(rows: QueuedAttachment[]): boolean { |
| 121 | return rows.some(r => r.status === 'uploading'); |
no outgoing calls
no test coverage detected