Skip to content

Commit 6d9081d

Browse files
authored
Handle null searchQuery in History component
1 parent 3bf8751 commit 6d9081d

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

client/src/Pages/Music/History.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ const HistoryPage = () => {
193193
const isSearchActive = debouncedSearch && debouncedSearch.length >= 3
194194

195195
useEffect(() => {
196-
const q = searchQuery.trim()
196+
const q = (searchQuery ?? "").trim()
197197

198198
const timer = setTimeout(() => {
199199
if (q.length >= 3) {
@@ -212,7 +212,7 @@ const HistoryPage = () => {
212212
limit: pageSize,
213213
sortBy,
214214
sortOrder,
215-
searchQuery: isSearchActive ? debouncedSearch : null,
215+
searchQuery: isSearchActive ? debouncedSearch : "",
216216
})
217217

218218
const songs = data?.songs ?? []

0 commit comments

Comments
 (0)