feat(mobile): show sub count in trending

This commit is contained in:
DIYgod 2025-06-05 20:34:10 +08:00
parent 6ac63065c9
commit bdb6802485
No known key found for this signature in database
3 changed files with 12 additions and 4 deletions

View File

@ -135,7 +135,7 @@ export const RecommendationTab: TabComponent<{
staleTime: 1000 * 60 * 60 * 24, // 1 day
})
const { data: analysisData } = useQuery({
const { data: analysisData, isLoading: isAnalysisLoading } = useQuery({
queryKey: ["rsshub-analysis", "cache", discoverLanguage],
queryFn: () => fetchRsshubAnalysis(LanguageMap[discoverLanguage]).then((res) => res.data),
staleTime: 1000 * 60 * 60 * 24, // 1 day
@ -228,7 +228,7 @@ export const RecommendationTab: TabComponent<{
const insets = useSafeAreaInsets()
if (isLoading) {
if (isLoading || isAnalysisLoading) {
return <PlatformActivityIndicator className="flex-1 items-center justify-center" />
}

View File

@ -9,6 +9,7 @@ import { ItemPressableStyle } from "@/src/components/ui/pressable/enum"
import { ItemPressable } from "@/src/components/ui/pressable/ItemPressable"
import { FilterCuteReIcon } from "@/src/icons/filter_cute_re"
import { TrendingUpCuteReIcon } from "@/src/icons/trending_up_cute_re"
import { User3CuteReIcon } from "@/src/icons/user_3_cute_re"
import { useNavigation } from "@/src/lib/navigation/hooks"
import { DiscoverSettingsScreen } from "@/src/screens/(modal)/DiscoverSettingsScreen"
@ -83,7 +84,12 @@ export const Trending = ({
</Text>
</View>
}
/>
>
<View className="flex flex-row items-center gap-1 opacity-60">
<User3CuteReIcon width={13} height={13} />
<Text className="text-text text-sm">{item.analytics.subscriptionCount}</Text>
</View>
</FeedSummary>
))
)}
</View>

View File

@ -41,7 +41,9 @@ const formSchema = z.object({
export function FollowFeed(props: { id: string }) {
const { id } = props
const feed = useFeed(id as string)
usePrefetchFeed(id as string)
usePrefetchFeed(id as string, {
enabled: !feed?.subscriptionCount,
})
if (!feed) {
return (