Improve caption editor usability, new 'add attachment' affordance

This commit is contained in:
Scott Nonnenberg 2019-01-15 09:33:23 -08:00
parent ac1a6d197a
commit 0de54e125c
14 changed files with 224 additions and 61 deletions

View file

@ -389,7 +389,9 @@ function getImageDimensions(attachment: AttachmentType): DimensionsType {
};
}
function areAllAttachmentsVisual(attachments?: Array<AttachmentType>): boolean {
export function areAllAttachmentsVisual(
attachments?: Array<AttachmentType>
): boolean {
if (!attachments) {
return false;
}
@ -397,7 +399,7 @@ function areAllAttachmentsVisual(attachments?: Array<AttachmentType>): boolean {
const max = attachments.length;
for (let i = 0; i < max; i += 1) {
const attachment = attachments[i];
if (!isImageAttachment(attachment) || !isVideoAttachment(attachment)) {
if (!isImageAttachment(attachment) && !isVideoAttachment(attachment)) {
return false;
}
}