From 9e1d4b70b0d0c4ee7f888ca898c683682202072d Mon Sep 17 00:00:00 2001 From: Jeff Sieu Date: Sat, 22 Oct 2022 17:35:42 +0800 Subject: [PATCH] [questions][fix] fix landing component --- apps/portal/src/components/questions/LandingComponent.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/portal/src/components/questions/LandingComponent.tsx b/apps/portal/src/components/questions/LandingComponent.tsx index 4f7837da..2e1795c9 100644 --- a/apps/portal/src/components/questions/LandingComponent.tsx +++ b/apps/portal/src/components/questions/LandingComponent.tsx @@ -42,7 +42,7 @@ export default function LandingComponent({ }; const handleChangeLocation = (newLocation: FilterChoice) => { - setCompany(newLocation); + setLocation(newLocation); }; const handleChangeType = (newQuestionType: QuestionsQuestionType) => { @@ -56,7 +56,7 @@ export default function LandingComponent({ }, [defaultCompany, company]); useEffect(() => { - if (location !== undefined) { + if (location === undefined) { setLocation(defaultLocation); } }, [defaultLocation, location]);