@@ -31,7 +31,9 @@ import { rollupRankingServiceURL } from "@/services/config"
3131import { fetchRollups , fetchRollupsRanking } from " @/services/api/rollup"
3232
3333/** Stores */
34+ import { useAppStore } from " @/store/app.store"
3435import { useEnumStore } from " @/store/enums.store"
36+ const appStore = useAppStore ()
3537const enumStore = useEnumStore ()
3638
3739useHead ({
@@ -289,17 +291,19 @@ const getRollups = async () => {
289291 ranking[rank .slug ] = rank
290292 })
291293
292- rollups .value = data .map ((r ) => {
293- const rank = ranking[r .slug ]
294- if (! rank) return r
295-
296- return {
297- ... r,
298- rank: + rank .rank ,
299- rounded_rank: roundTo (rank .rank / 10 , 0 ),
300- rank_category: getRankCategory (roundTo (rank .rank / 10 , 0 )),
301- }
302- })
294+ if (data .length ) {
295+ rollups .value = data .map ((r ) => {
296+ const rank = ranking[r .slug ]
297+ if (! rank) return r
298+
299+ return {
300+ ... r,
301+ rank: + rank .rank ,
302+ rounded_rank: roundTo (rank .rank / 10 , 0 ),
303+ rank_category: getRankCategory (roundTo (rank .rank / 10 , 0 )),
304+ }
305+ })
306+ }
303307 }
304308 }
305309
@@ -310,6 +314,12 @@ const getRollups = async () => {
310314 }
311315}
312316const processRollups = () => {
317+ if (! rollups .value ? .length ) {
318+ processedRollups .value = []
319+ isRefetching .value = false
320+ return
321+ }
322+
313323 isRefetching .value = true
314324
315325 const selected = Object .keys (filters).reduce ((acc , key ) => {
0 commit comments