show video feeds from posts even if they are replies (#7516)
* show video feeds from posts even if they are replies * only show feed post in VideoFeed
This commit is contained in:
@@ -41,6 +41,7 @@ export class FeedViewPostsSlice {
|
||||
isFallbackMarker: boolean
|
||||
isOrphan: boolean
|
||||
rootUri: string
|
||||
feedPostUri: string
|
||||
|
||||
constructor(feedPost: FeedViewPost) {
|
||||
const {post, reply, reason} = feedPost
|
||||
@@ -48,6 +49,7 @@ export class FeedViewPostsSlice {
|
||||
this.isIncompleteThread = false
|
||||
this.isFallbackMarker = false
|
||||
this.isOrphan = false
|
||||
this.feedPostUri = post.uri
|
||||
if (AppBskyFeedDefs.isPostView(reply?.root)) {
|
||||
this.rootUri = reply.root.uri
|
||||
} else {
|
||||
|
||||
@@ -206,11 +206,14 @@ function Feed() {
|
||||
feedContext: string | undefined
|
||||
}[] = []
|
||||
for (const slice of page.slices) {
|
||||
for (const i of slice.items) {
|
||||
const feedPost = slice.items.find(
|
||||
item => item.uri === slice.feedPostUri,
|
||||
)
|
||||
if (feedPost) {
|
||||
items.push({
|
||||
_reactKey: i._reactKey,
|
||||
moderation: i.moderation,
|
||||
post: i.post,
|
||||
_reactKey: feedPost._reactKey,
|
||||
moderation: feedPost.moderation,
|
||||
post: feedPost.post,
|
||||
feedContext: slice.feedContext,
|
||||
})
|
||||
}
|
||||
|
||||
@@ -89,6 +89,7 @@ export interface FeedPostSlice {
|
||||
isIncompleteThread: boolean
|
||||
isFallbackMarker: boolean
|
||||
feedContext: string | undefined
|
||||
feedPostUri: string
|
||||
reason?:
|
||||
| AppBskyFeedDefs.ReasonRepost
|
||||
| AppBskyFeedDefs.ReasonPin
|
||||
@@ -330,6 +331,7 @@ export function usePostFeedQuery(
|
||||
isFallbackMarker: slice.isFallbackMarker,
|
||||
feedContext: slice.feedContext,
|
||||
reason: slice.reason,
|
||||
feedPostUri: slice.feedPostUri,
|
||||
items: slice.items.map((item, i) => {
|
||||
const feedPostSliceItem: FeedPostSliceItem = {
|
||||
_reactKey: `${slice._reactKey}-${i}-${item.post.uri}`,
|
||||
|
||||
@@ -347,7 +347,9 @@ let PostFeed = ({
|
||||
}[] = []
|
||||
for (const page of data.pages) {
|
||||
for (const slice of page.slices) {
|
||||
const item = slice.items.at(0)
|
||||
const item = slice.items.find(
|
||||
item => item.uri === slice.feedPostUri,
|
||||
)
|
||||
if (item && AppBskyEmbedVideo.isView(item.post.embed)) {
|
||||
videos.push({item, feedContext: slice.feedContext})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user