refetch home

This commit is contained in:
Violet Caulfield
2025-01-20 21:19:51 -06:00
parent 1cf131d375
commit e0c42dc68e
+12 -2
View File
@@ -9,19 +9,29 @@ import { useHomeContext } from "../provider";
import { H3 } from "../../../components/Global/helpers/text";
import Avatar from "../../../components/Global/helpers/avatar";
import Client from "../../../api/client";
import { usePlayerContext } from "@/player/provider";
import { useEffect } from "react";
export function ProvidedHome({ route, navigation }: ProvidedHomeProps): React.JSX.Element {
const { refreshing: refetching, onRefresh: onRefetch } = useHomeContext()
const { nowPlayingIsFavorite } = usePlayerContext();
useEffect(() => {
onRefetch()
}, [
nowPlayingIsFavorite
])
return (
<SafeAreaView edges={["top", "right", "left"]}>
<ScrollView
contentInsetAdjustmentBehavior="automatic"
refreshControl={
<RefreshControl
refreshing={refetching}
onRefresh={onRefetch}
refreshing={refetching}
onRefresh={onRefetch}
/>
}>
<YStack alignContent='flex-start'>