use videoId for refresh dependency

This commit is contained in:
Simon
2025-03-07 10:39:14 +07:00
parent 0fc86407be
commit 9c847f492a
4 changed files with 4 additions and 8 deletions

View File

@@ -45,7 +45,6 @@ const ChannelVideo = ({ videoType }: ChannelVideoProps) => {
const channel = channelResponse;
const videoList = videoResponse?.data;
const pagination = videoResponse?.paginate;
const refreshWhenVideoIdChanges = videoId !== null;
const hasVideos = videoResponse?.data?.length !== 0;
@@ -81,7 +80,7 @@ const ChannelVideo = ({ videoType }: ChannelVideoProps) => {
channelId,
pagination?.current_page,
videoType,
refreshWhenVideoIdChanges,
videoId,
]);
if (!channel) {

View File

@@ -117,7 +117,6 @@ const Home = () => {
const videoList = videoResponse?.data;
const pagination = videoResponse?.paginate;
const continueVideos = continueVideoResponse?.data;
const refreshWhenVideoIdChanges = videoId !== null;
const hasVideos = videoResponse?.data?.length !== 0;
@@ -153,7 +152,7 @@ const Home = () => {
userConfig.hide_watched,
currentPage,
pagination?.current_page,
refreshWhenVideoIdChanges,
videoId,
]);
return (

View File

@@ -56,7 +56,6 @@ const Playlist = () => {
const palylistEntries = playlistResponse?.playlist_entries;
const videoArchivedCount = Number(palylistEntries?.filter(video => video.downloaded).length);
const videoInPlaylistCount = pagination?.total_hits;
const refreshWhenVideoIdChanges = videoId !== null;
const view = userConfig.view_style_home;
const gridItems = userConfig.grid_items;
@@ -93,7 +92,7 @@ const Playlist = () => {
refresh,
currentPage,
pagination?.current_page,
refreshWhenVideoIdChanges,
videoId,
]);
if (!playlistId || !playlist) {

View File

@@ -56,7 +56,6 @@ const Search = () => {
const playlistList = searchResults?.results.playlist_results;
const fulltextList = searchResults?.results.fulltext_results;
const queryType = searchResults?.queryType;
const refreshWhenVideoIdChanges = videoId !== null;
const hasSearchQuery = searchTerm.length > 0;
const hasVideos = Number(videoList?.length) > 0;
@@ -90,7 +89,7 @@ const Search = () => {
} else {
setSearchResults(EmptySearchResponse);
}
}, [debouncedSearchTerm, refresh, refreshWhenVideoIdChanges]);
}, [debouncedSearchTerm, refresh, videoId]);
const fetchResults = async (searchQuery: string) => {
const searchResults = await loadSearch(searchQuery);