about summary refs log tree commit diff
path: root/src/view/com/posts/PostFeed.tsx
diff options
context:
space:
mode:
authorSamuel Newman <mozzius@protonmail.com>2025-05-17 01:38:34 +0300
committerGitHub <noreply@github.com>2025-05-16 15:38:34 -0700
commit1cdbfc709235ed1933ba51403d941762f384690b (patch)
treef55aa9a16f05645bcc5c2d63839113725b1ca308 /src/view/com/posts/PostFeed.tsx
parent75ffb3d243a5415d173f2bca8a5334b70451a1f4 (diff)
downloadvoidsky-1cdbfc709235ed1933ba51403d941762f384690b.tar.zst
Live via service config (#8378)
* add config (with temp config)

* only allow whitelisted domains in form

* move config to generic config

* use array-based config

* update deps

* rm expect-error
Diffstat (limited to 'src/view/com/posts/PostFeed.tsx')
-rw-r--r--src/view/com/posts/PostFeed.tsx12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/view/com/posts/PostFeed.tsx b/src/view/com/posts/PostFeed.tsx
index b4c2b2710..732d0fcab 100644
--- a/src/view/com/posts/PostFeed.tsx
+++ b/src/view/com/posts/PostFeed.tsx
@@ -19,7 +19,7 @@ import {msg} from '@lingui/macro'
 import {useLingui} from '@lingui/react'
 import {useQueryClient} from '@tanstack/react-query'
 
-import {isStatusStillActive} from '#/lib/actor-status'
+import {isStatusStillActive, validateStatus} from '#/lib/actor-status'
 import {DISCOVER_FEED_URI, KNOWN_SHUTDOWN_FEEDS} from '#/lib/constants'
 import {useInitialNumToRender} from '#/lib/hooks/useInitialNumToRender'
 import {logEvent} from '#/lib/statsig/statsig'
@@ -39,6 +39,7 @@ import {
   RQKEY,
   usePostFeedQuery,
 } from '#/state/queries/post-feed'
+import {useLiveNowConfig} from '#/state/service-config'
 import {useSession} from '#/state/session'
 import {useProgressGuide} from '#/state/shell/progress-guide'
 import {List, type ListRef} from '#/view/com/util/List'
@@ -53,7 +54,6 @@ import {
 } from '#/components/feeds/PostFeedVideoGridRow'
 import {TrendingInterstitial} from '#/components/interstitials/Trending'
 import {TrendingVideos as TrendingVideosInterstitial} from '#/components/interstitials/TrendingVideos'
-import {temp__canBeLive, temp__isStatusValid} from '#/components/live/temp'
 import {DiscoverFallbackHeader} from './DiscoverFallbackHeader'
 import {FeedShutdownMsg} from './FeedShutdownMsg'
 import {PostFeedErrorMessage} from './PostFeedErrorMessage'
@@ -777,16 +777,18 @@ let PostFeed = ({
     )
   }, [isFetchingNextPage, shouldRenderEndOfFeed, renderEndOfFeed, headerOffset])
 
+  const liveNowConfig = useLiveNowConfig()
+
   const seenActorWithStatusRef = useRef<Set<string>>(new Set())
   const onItemSeen = useCallback(
     (item: FeedRow) => {
       feedFeedback.onItemSeen(item)
       if (item.type === 'sliceItem') {
         const actor = item.slice.items[item.indexInSlice].post.author
+
         if (
           actor.status &&
-          temp__canBeLive(actor) &&
-          temp__isStatusValid(actor.status) &&
+          validateStatus(actor.did, actor.status, liveNowConfig) &&
           isStatusStillActive(actor.status.expiresAt)
         ) {
           if (!seenActorWithStatusRef.current.has(actor.did)) {
@@ -799,7 +801,7 @@ let PostFeed = ({
         }
       }
     },
-    [feedFeedback, feed],
+    [feedFeedback, feed, liveNowConfig],
   )
 
   return (