From bedc3ab5a1fd05a267c0cb7ffdf705cbd1169951 Mon Sep 17 00:00:00 2001 From: Aaryan Khandelwal <65252264+aaryan610@users.noreply.github.com> Date: Thu, 27 Jul 2023 21:38:16 +0530 Subject: [PATCH] fix: create view form (#1691) --- apps/app/components/views/form.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/app/components/views/form.tsx b/apps/app/components/views/form.tsx index 7001bbab7..9191a7b2b 100644 --- a/apps/app/components/views/form.tsx +++ b/apps/app/components/views/form.tsx @@ -60,20 +60,20 @@ export const ViewForm: React.FC = ({ const filters = watch("query"); const { data: stateGroups } = useSWR( - workspaceSlug && projectId && (filters.state ?? []).length > 0 + workspaceSlug && projectId && (filters?.state ?? []).length > 0 ? STATES_LIST(projectId as string) : null, - workspaceSlug && (filters.state ?? []).length > 0 + workspaceSlug && (filters?.state ?? []).length > 0 ? () => stateService.getStates(workspaceSlug as string, projectId as string) : null ); const states = getStatesList(stateGroups); const { data: labels } = useSWR( - workspaceSlug && projectId && (filters.labels ?? []).length > 0 + workspaceSlug && projectId && (filters?.labels ?? []).length > 0 ? PROJECT_ISSUE_LABELS(projectId.toString()) : null, - workspaceSlug && projectId && (filters.labels ?? []).length > 0 + workspaceSlug && projectId && (filters?.labels ?? []).length > 0 ? () => issuesService.getIssueLabels(workspaceSlug.toString(), projectId.toString()) : null );