Refac refresh video list when videoId changing

This commit is contained in:
MerlinScheurer
2025-03-06 23:54:12 +01:00
parent 838c6ae145
commit 0fc86407be
4 changed files with 15 additions and 2 deletions

View File

@@ -56,6 +56,7 @@ 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;
@@ -89,7 +90,7 @@ const Search = () => {
} else {
setSearchResults(EmptySearchResponse);
}
}, [debouncedSearchTerm, refresh]);
}, [debouncedSearchTerm, refresh, refreshWhenVideoIdChanges]);
const fetchResults = async (searchQuery: string) => {
const searchResults = await loadSearch(searchQuery);