diff --git a/src/screens/VideoFeed/index.tsx b/src/screens/VideoFeed/index.tsx
index 5fdc7a0aae..ac93d72595 100644
--- a/src/screens/VideoFeed/index.tsx
+++ b/src/screens/VideoFeed/index.tsx
@@ -140,15 +140,16 @@ export function VideoFeed({}: NativeStackScreenProps<
]}>
-
+
)
}
-function Inner() {
+function Feed() {
const {params} = useRoute>()
const isFocused = useIsFocused()
+ const {hasSession} = useSession()
const feedDesc = useMemo(() => {
switch (params.type) {
case 'feedgen':
@@ -161,7 +162,7 @@ function Inner() {
throw new Error(`Invalid video feed params ${JSON.stringify(params)}`)
}
}, [params])
-
+ const feedFeedback = useFeedFeedback(feedDesc, hasSession)
const {
data,
isFetching,
@@ -170,18 +171,19 @@ function Inner() {
isFetchingNextPage,
fetchNextPage,
} = usePostFeedQuery(feedDesc)
- const {hasSession} = useSession()
- const feedFeedback = useFeedFeedback(feedDesc, hasSession)
-
- let videos = data?.pages.flatMap(page =>
- page.slices.flatMap(slice => slice.items),
- )
- const startingVideoIndex = videos?.findIndex(video => {
- return video.post.uri === params.initialPostUri
- })
- if (videos && startingVideoIndex && startingVideoIndex > -1) {
- videos = videos.slice(startingVideoIndex)
- }
+ const videos = React.useMemo(() => {
+ let vids =
+ data?.pages
+ .flatMap(page => page.slices.flatMap(slice => slice.items))
+ .filter(item => AppBskyEmbedVideo.isView(item.post.embed)) || []
+ const startingVideoIndex = vids?.findIndex(video => {
+ return video.post.uri === params.initialPostUri
+ })
+ if (vids && startingVideoIndex && startingVideoIndex > -1) {
+ vids = vids.slice(startingVideoIndex)
+ }
+ return vids
+ }, [data, params.initialPostUri])
const [currentSources, setCurrentSources] = useState<
[string | null, string | null, string | null]