From a6cf58ea7ff5eb697c572bad058a70719dfa4843 Mon Sep 17 00:00:00 2001 From: zephyrdark Date: Sun, 18 Aug 2024 15:33:36 +0800 Subject: [PATCH 1/2] front-react-home_page: fix toast showing for admin --- front/react/src/pages/HomePage.js | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/front/react/src/pages/HomePage.js b/front/react/src/pages/HomePage.js index dd41aa12..91fac5ec 100644 --- a/front/react/src/pages/HomePage.js +++ b/front/react/src/pages/HomePage.js @@ -21,14 +21,16 @@ const HomePage = () => { const profileData = response.data.data; setRecommendedPortfolioType(profileData.recommendedPortfolioType); } catch (error) { - toast({ - title: "Fetch Investor Profile Error", - description: "Unable to fetch your recommended portfolio! Please complete your investor profile.", - status: "error", - duration: 3000, - isClosable: true, - position: "top", - }); + if (isAuthenticated && isCustomer) { + toast({ + title: "Fetch Investor Profile Error", + description: "Unable to fetch your recommended portfolio! Please complete your investor profile.", + status: "error", + duration: 3000, + isClosable: true, + position: "top", + }); + } } }; fetchInvestorProfile(); From 2e9390eb21451e527d0df7e74ff2afbceb9c8f72 Mon Sep 17 00:00:00 2001 From: zephyrdark Date: Sun, 18 Aug 2024 15:38:00 +0800 Subject: [PATCH 2/2] front-react-home_page: add missing var for cicd --- front/react/src/pages/HomePage.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/front/react/src/pages/HomePage.js b/front/react/src/pages/HomePage.js index 91fac5ec..d326e733 100644 --- a/front/react/src/pages/HomePage.js +++ b/front/react/src/pages/HomePage.js @@ -34,7 +34,7 @@ const HomePage = () => { } }; fetchInvestorProfile(); - }, [isAuthenticated, toast]); + }, [isAuthenticated, isCustomer, toast]); const imageCardDetails = () => { if (!isAuthenticated) {