fix: fetch mods withoud limit filter on landing page and apply limit once retrived
All checks were successful
Release to Staging / build_and_release (push) Successful in 45s

This commit is contained in:
daniyal 2024-09-03 15:23:07 +05:00
parent 4b51fa55f5
commit 03f9269eb6

View File

@ -249,10 +249,12 @@ const DisplayLatestMods = () => {
const [latestMods, setLatestMods] = useState<ModDetails[]>([])
useDidMount(() => {
fetchMods({ source: window.location.host, limit: 4 })
fetchMods({ source: window.location.host })
.then((res) => {
res.sort((a, b) => b.published_at - a.published_at)
setLatestMods(res)
const mods = res
.sort((a, b) => b.published_at - a.published_at)
.slice(0, 4)
setLatestMods(mods)
})
.finally(() => {
setIsFetchingLatestMods(false)