fedimbed: fix cutoff if <4

This commit is contained in:
Cynthia Foxwell 2023-11-29 01:36:54 -07:00
parent b65865b10f
commit ce4cc0cbff
1 changed files with 3 additions and 3 deletions

View File

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