fix tests
This commit is contained in:
parent
f21d1dbac8
commit
d19877ed8e
4 changed files with 83 additions and 13 deletions
|
|
@ -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
|
||||
},
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue