Skip to content

Commit

Permalink
Fixed error with infinite loop when no dataset provided
Browse files Browse the repository at this point in the history
  • Loading branch information
boandriy committed Jan 11, 2022
1 parent 6376ebf commit 9c332fb
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/features/splash/Splash.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ const Splash: React.FC<{}> = () => {

const [selectedFeaturedDatasetType, setSelectedFeaturedDatasetType] = useState('popular')
useEffect(() => {
if (!datasets[Object.keys(datasets)[0]].length) {
loadSplashDatasets()(dispatch)
} else {
setSelectedFeaturedDatasetType(Object.keys(datasets)[0])
}
loadSplashDatasets()(dispatch)
}, [])

useEffect(() => {
setSelectedFeaturedDatasetType(Object.keys(datasets)[0])
}, [ datasets ])

const handleSearchSubmit = (query: string) => {
Expand Down

0 comments on commit 9c332fb

Please sign in to comment.