From ced4e393274b32322e31eb8dab7f7f58d2549023 Mon Sep 17 00:00:00 2001 From: Emanuele Fumagalli Date: Mon, 2 Oct 2023 16:36:44 +0100 Subject: [PATCH] updates --- go.mod | 2 +- go.sum | 6 ++---- website/src/App.tsx | 8 +++----- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/go.mod b/go.mod index 2ec9aa8..fdc8b2b 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.21.1 require ( github.com/Code-Hex/go-generics-cache v1.3.1 - github.com/emanuelef/github-repo-activity-stats v0.0.0-20231001064852-5063577ee96b + github.com/emanuelef/github-repo-activity-stats v0.0.0-20231002005209-1312a046d21b github.com/gofiber/contrib/otelfiber v1.0.10 github.com/gofiber/fiber/v2 v2.49.2 github.com/joho/godotenv v1.5.1 diff --git a/go.sum b/go.sum index 804cd7f..cfab7fc 100644 --- a/go.sum +++ b/go.sum @@ -6,10 +6,8 @@ github.com/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqy github.com/cenkalti/backoff/v4 v4.2.1/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/emanuelef/github-repo-activity-stats v0.0.0-20231001062114-4a8aa1407f89 h1:7ZHVvnPGOM6fHApWHGiqlhMY7Y1G1E4aI2pw8/ZbGEQ= -github.com/emanuelef/github-repo-activity-stats v0.0.0-20231001062114-4a8aa1407f89/go.mod h1:HxMMesEDFwP2qwMujqHXlPS3YAclZLYKFFmf2MPCmPk= -github.com/emanuelef/github-repo-activity-stats v0.0.0-20231001064852-5063577ee96b h1:rYE/+6Xf6uT2RFkb2KAKoVGcjtPwe1NB703o4Qlk94s= -github.com/emanuelef/github-repo-activity-stats v0.0.0-20231001064852-5063577ee96b/go.mod h1:HxMMesEDFwP2qwMujqHXlPS3YAclZLYKFFmf2MPCmPk= +github.com/emanuelef/github-repo-activity-stats v0.0.0-20231002005209-1312a046d21b h1:2TpL/2a/UXqpFIecyWA9x94sXxoqN1NJAXZCwD/+PMs= +github.com/emanuelef/github-repo-activity-stats v0.0.0-20231002005209-1312a046d21b/go.mod h1:HxMMesEDFwP2qwMujqHXlPS3YAclZLYKFFmf2MPCmPk= github.com/felixge/httpsnoop v1.0.3 h1:s/nj+GCswXYzN5v2DpNMuMQYe+0DDwt5WVCU6CWBdXk= github.com/felixge/httpsnoop v1.0.3/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= diff --git a/website/src/App.tsx b/website/src/App.tsx index b59daf2..47f833c 100644 --- a/website/src/App.tsx +++ b/website/src/App.tsx @@ -75,7 +75,7 @@ const parseGitHubRepoURL = (url) => { function App() { const [selectedRepo, setSelectedRepo] = useState("helm/helm-mapkubeapis"); const [collapsed, setCollapsed] = useState(true); - const [result, setResult] = useState(""); + const [result, setResult] = useState({}); const [totalRequests, setTotalRequests] = useState(60); const [remainingRequests, setRemainingRequests] = useState(totalRequests); const [resetLimitsTime, setResetLimitsTime] = useState(60); @@ -123,7 +123,7 @@ function App() { fetchRepoStats(selectedRepo); const intervalId = setInterval(fetchLimits, 30000); return () => clearInterval(intervalId); - }, []); + }, [selectedRepo]); const handleClick = async () => { fetchRepoStats(parseGitHubRepoURL(selectedRepo)); @@ -172,9 +172,7 @@ function App() { text="API Limits reset" totalTime={resetLimitsTime} /> -
- -
+
{result && }
); };