From 07bcaa22fd1ec397622eccb87cff66b5d31d4df4 Mon Sep 17 00:00:00 2001 From: Steven Yi Date: Wed, 29 Jan 2025 11:43:10 -0500 Subject: [PATCH] fix: clear congestion banner when status is succesful within congestion window --- CHANGELOG.md | 6 ++++++ package.json | 2 +- src/components/GlobalDataProvider.tsx | 5 +++-- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 65d519d..3c9edca 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [1.8.1] - 2025-01-29 + +### Fixed + +- Clear congestion banner when network returns to normal + ## [1.8.0] - 2025-01-28 ### Added diff --git a/package.json b/package.json index a5a1d07..b494025 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@ar-io/network-portal", "private": true, - "version": "1.8.0", + "version": "1.8.1", "type": "module", "scripts": { "build": "yarn clean && tsc --build tsconfig.build.json && NODE_OPTIONS=--max-old-space-size=32768 vite build", diff --git a/src/components/GlobalDataProvider.tsx b/src/components/GlobalDataProvider.tsx index 2d8a161..0e50c45 100644 --- a/src/components/GlobalDataProvider.tsx +++ b/src/components/GlobalDataProvider.tsx @@ -81,8 +81,9 @@ const GlobalDataProvider = ({ children }: { children: ReactElement }) => { if (!res.ok) { log.error('AO CU URL is down'); setAoCongested(true); - } else if (endTime - startTime > CONGESTION_WINDOW) { - setAoCongested(true); + } else { + const congested = endTime - startTime > CONGESTION_WINDOW; + setAoCongested(congested); } }) .catch((error) => {