diff --git a/packages/ui-app/app/_features/ProjectContainer/useGetTask.ts b/packages/ui-app/app/_features/ProjectContainer/useGetTask.ts index df388f7a..b4e25289 100644 --- a/packages/ui-app/app/_features/ProjectContainer/useGetTask.ts +++ b/packages/ui-app/app/_features/ProjectContainer/useGetTask.ts @@ -9,6 +9,9 @@ import useTaskFilterContext from '../TaskFilter/useTaskFilterContext' import { getGoalieUser } from '@goalie/nextjs' const getAssigneeIds = (assigneeIds: string[]) => { + if (!assigneeIds || !assigneeIds.length) return ['null'] + if (assigneeIds.includes('ALL')) return undefined + assigneeIds = assigneeIds.map(uid => { const user = getGoalieUser() if (uid === 'ME' && user?.id) { @@ -17,8 +20,6 @@ const getAssigneeIds = (assigneeIds: string[]) => { return uid }) - if (assigneeIds.includes('ALL')) return undefined - if (!assigneeIds.length) return ['null'] return assigneeIds.filter(a => a !== 'ALL') }