Maybe fix row generation
This commit is contained in:
@@ -323,12 +323,19 @@ let PostFeed = ({
|
|||||||
})
|
})
|
||||||
} else if (data) {
|
} else if (data) {
|
||||||
let sliceIndex = -1
|
let sliceIndex = -1
|
||||||
for (const page of data?.pages) {
|
|
||||||
if (isVideoFeed && isNative) {
|
if (isVideoFeed && isNative) {
|
||||||
const rows: FeedPostSliceItem[][] = []
|
const rows: FeedPostSliceItem[][] = []
|
||||||
for (let i = 0; i < page.slices.length; i++) {
|
let slices: {slice: FeedPostSlice; index: number}[] = []
|
||||||
const slice = page.slices[i]
|
for (const page of data.pages) {
|
||||||
const root = slice.items.at(0)
|
for (const slice of page.slices) {
|
||||||
|
slices.push({slice, index: sliceIndex++})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (let i = 0; i < slices.length; i++) {
|
||||||
|
const slice = slices[i]
|
||||||
|
const root = slice.slice.items.at(0)
|
||||||
if (!root) continue
|
if (!root) continue
|
||||||
// TODO test this
|
// TODO test this
|
||||||
if (!AppBskyEmbedVideo.isView(root.post.embed)) {
|
if (!AppBskyEmbedVideo.isView(root.post.embed)) {
|
||||||
@@ -345,7 +352,6 @@ let PostFeed = ({
|
|||||||
|
|
||||||
for (const row of rows) {
|
for (const row of rows) {
|
||||||
sliceIndex++
|
sliceIndex++
|
||||||
|
|
||||||
arr.push({
|
arr.push({
|
||||||
type: 'videoGridRow',
|
type: 'videoGridRow',
|
||||||
key: row.map(r => r._reactKey).join('-'),
|
key: row.map(r => r._reactKey).join('-'),
|
||||||
@@ -354,6 +360,7 @@ let PostFeed = ({
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
for (const page of data?.pages) {
|
||||||
for (const slice of page.slices) {
|
for (const slice of page.slices) {
|
||||||
sliceIndex++
|
sliceIndex++
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user