diff --git a/dashboard/src/libs/application.tsx b/dashboard/src/libs/application.tsx index 4425794d..6dca55e2 100644 --- a/dashboard/src/libs/application.tsx +++ b/dashboard/src/libs/application.tsx @@ -183,19 +183,15 @@ export const useApplicationsFilter = ( includeNoApp: boolean, sort: 'asc' | 'desc', ): RepoWithApp[] => { - const filteredReposByOrigin = () => { - return repos.filter((r) => origins.includes(repositoryURLToOrigin(r.url))) ?? [] - } - const filteredApps = () => { - return apps.filter((a) => statuses.includes(applicationState(a))) ?? [] - } + const filteredReposByOrigin = repos.filter((r) => origins.includes(repositoryURLToOrigin(r.url))) + const filteredApps = apps.filter((a) => statuses.includes(applicationState(a))) const appsMap = {} as Record - for (const app of filteredApps()) { + for (const app of filteredApps) { if (!appsMap[app.repositoryId]) appsMap[app.repositoryId] = [] appsMap[app.repositoryId].push(app) } - const res = filteredReposByOrigin().reduce((acc, repo) => { + const res = filteredReposByOrigin.reduce((acc, repo) => { if (!includeNoApp && !appsMap[repo.id]) return acc acc.push({ repo, apps: appsMap[repo.id] || [] }) return acc