Skip to content

Commit

Permalink
SMA-104: page is set to 0 when selected sports change to clear the fi…
Browse files Browse the repository at this point in the history
…lteredEvent
  • Loading branch information
ivamach committed Apr 21, 2024
1 parent ce3561e commit ac82146
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion frontend/sportsmatch-app/src/pages/Index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,13 @@ export default function MainPage() {
setSelectedSports(selectedButtonSports)
}

// setting the page to 0 when selected sports change to clear the filteredEvent
useEffect(() => {
setPage(0)
}, [selectedSports])

const clear = () => {
setPage(0)
setFilteredEvent([])
setSelectedSports([])
setClearFilters(true)
setTimeout(() => {
Expand Down

0 comments on commit ac82146

Please sign in to comment.