Skip to content

Commit 7b13b23

Browse files
committed
fix(search): disable sorting and order on no results
1 parent 26d27cd commit 7b13b23

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

apps/frontend/src/modules/song-search/SearchSongPage.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -561,7 +561,7 @@ export const SearchSongPage = () => {
561561
<select
562562
value={sort}
563563
onChange={(e) => handleSortChange(e.target.value)}
564-
disabled={loading}
564+
disabled={loading || songs.length === 0}
565565
className='h-10 w-48 rounded-md bg-zinc-900 border-2 border-zinc-600 hover:enabled:border-zinc-500 disabled:opacity-50 focus:border-blue-500 focus:outline-hidden px-1.5 text-sm transition-colors'
566566
>
567567
<option value={SongSortType.RECENT}>Recent</option>
@@ -576,7 +576,7 @@ export const SearchSongPage = () => {
576576
<button
577577
className='bg-zinc-700 hover:enabled:bg-zinc-600 disabled:opacity-50 h-10 w-10 rounded-md flex items-center justify-center transition-colors enabled:cursor-pointer'
578578
onClick={handleOrderChange}
579-
disabled={loading}
579+
disabled={loading || songs.length === 0}
580580
aria-label={
581581
order === SongOrderType.ASC
582582
? 'Sort ascending'

0 commit comments

Comments
 (0)