From 00466c731ee11b5eed7595a3fe46320b1e45cec7 Mon Sep 17 00:00:00 2001 From: Aman Harwara Date: Wed, 11 Jan 2023 23:11:34 +0530 Subject: [PATCH] fix: Fixed issue where "Open downloads" button would not show up for the latest version in "Whats New" --- .../Components/Preferences/Panes/WhatsNew/WhatsNew.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/web/src/javascripts/Components/Preferences/Panes/WhatsNew/WhatsNew.tsx b/packages/web/src/javascripts/Components/Preferences/Panes/WhatsNew/WhatsNew.tsx index f332deb8b..bc98cf308 100644 --- a/packages/web/src/javascripts/Components/Preferences/Panes/WhatsNew/WhatsNew.tsx +++ b/packages/web/src/javascripts/Components/Preferences/Panes/WhatsNew/WhatsNew.tsx @@ -49,6 +49,10 @@ const WhatsNew = ({ application }: { application: WebApplication }) => { ) } + const firstValidVersionIndex = changelog.versions.findIndex( + (version) => version.version && (getSectionItems(version, 'Bug Fixes') || getSectionItems(version, 'Features')), + ) + return ( {changelog.versions.map((version, index) => { @@ -65,12 +69,12 @@ const WhatsNew = ({ application }: { application: WebApplication }) => { const isUnreadVersion = lastReadVersion && compareSemVersions(version.version, lastReadVersion) > 0 - const isLatest = index === 0 + const isLatest = index === firstValidVersionIndex const isDesktopEnvironment = isDesktopApplication() const showDownloadLink = isDesktopEnvironment && isLatest return ( - +