fedimbed: fix cutoff if <4

This commit is contained in:
Cynthia Foxwell 2023-11-29 01:36:54 -07:00
parent b65865b10f
commit ce4cc0cbff

View file

@ -638,7 +638,7 @@ async function processUrl(msg, url, spoiler = false) {
const files = []; const files = [];
if (images.length > 0) { if (images.length > 0) {
if (images.length == 4) { if (images.length <= 4) {
for (const attachment of images) { for (const attachment of images) {
const embed = Object.assign({}, baseEmbed); const embed = Object.assign({}, baseEmbed);
embed.image = { embed.image = {
@ -712,7 +712,7 @@ async function processUrl(msg, url, spoiler = false) {
} }
if (images.length <= 14) { if (images.length <= 14) {
const fourteen = images.slice(10, Math.min(images.length, 14)); const fourteen = images.slice(10, 14);
for (const attachment of fourteen) { for (const attachment of fourteen) {
const embed = Object.assign({}, baseEmbed); const embed = Object.assign({}, baseEmbed);
@ -724,7 +724,7 @@ async function processUrl(msg, url, spoiler = false) {
} }
if (images.length <= 18) { if (images.length <= 18) {
const eighteen = images.slice(14, Math.min(images.length, 18)); const eighteen = images.slice(14, 18);
const _embed = { const _embed = {
url: baseEmbed.url + "?_", url: baseEmbed.url + "?_",
title: "Additional Images", title: "Additional Images",