From 580dcaea4e7aaa45a439f5d95d31fd4ea752140d Mon Sep 17 00:00:00 2001 From: Tiago Paiva Date: Mon, 6 Jan 2025 14:16:29 -0300 Subject: [PATCH] fix: handle fetch github stars errors (#4952) --- frontend/web/components/GithubStar.tsx | 31 +++++++++++++++----------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/frontend/web/components/GithubStar.tsx b/frontend/web/components/GithubStar.tsx index 3fbf6a2a475c..eed95c7816c5 100644 --- a/frontend/web/components/GithubStar.tsx +++ b/frontend/web/components/GithubStar.tsx @@ -21,6 +21,7 @@ const GithubStar: FC = ({}) => { .then(function (res) { setStars(res.stargazers_count) }) + .catch(() => {}) } }, [planName]) @@ -29,20 +30,24 @@ const GithubStar: FC = ({}) => { } return ( - <> - +
-
- -
{stars}
-
-
- + + {stars &&
{stars}
} +
+ ) }