fix tests

This commit is contained in:
Henry Jameson 2026-05-13 18:16:34 +03:00
commit d19877ed8e
4 changed files with 83 additions and 13 deletions

View file

@ -68,12 +68,23 @@ const Gallery = {
}
const maxPerRow = 3
const currentRow = acc[acc.length - 1].items
if ((nextWide || nextEnd) && currentRow.length >= maxPerRow) {
const last = currentRow.splice(-1)[0]
return [...acc, { items: [last, attachment] }]
const currentRow = acc[acc.length - 1]
const previousRow = acc[acc.length - 2]
if (currentRow.items.length >= maxPerRow) {
if (nextWide || nextEnd) {
if (previousRow?.items.length > 1) {
currentRow.items.push(attachment)
return [...acc, { items: [] }]
} else {
const last = currentRow.items.splice(-1)[0]
return [...acc, { items: [last, attachment] }]
}
} else {
return [...acc, { items: [attachment] }]
}
} else {
currentRow.push(attachment)
currentRow.items.push(attachment)
}
return acc
},

View file

@ -211,7 +211,11 @@ const PostStatusForm = {
poll: {},
hasPoll: false,
hasQuote: false,
quote: {},
quote: {
id: '',
url: '',
thread: false,
},
mediaDescriptions: {},
visibility: scope,
contentType,
@ -230,7 +234,11 @@ const PostStatusForm = {
poll: this.statusPoll || {},
hasPoll: false,
hasQuote: false,
quote: {},
quote: {
id: '',
url: '',
thread: false,
},
mediaDescriptions: this.statusMediaDescriptions || {},
visibility: this.statusScope || scope,
contentType: statusContentType,