From b81cc8ec17642f47812aeb94937d1ee21a9ec800 Mon Sep 17 00:00:00 2001 From: schroda <50052685+schroda@users.noreply.github.com> Date: Mon, 18 Aug 2025 22:52:28 +0200 Subject: [PATCH] Show available extension updates in navbar --- public/locales/en.json | 1 + .../navigation-bar/NavigationBar.constants.ts | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/public/locales/en.json b/public/locales/en.json index 6ed258cf..26434ccf 100644 --- a/public/locales/en.json +++ b/public/locales/en.json @@ -281,6 +281,7 @@ "label": { "add_repository_info": "You have to add a extension repository to be able to install extensions", "age_rating": "Age rating", + "available_updates": "{{count}} available updates", "installation_failed_one": "Could not install the extension", "installation_failed_other": "Could not install the extensions", "installed_successfully_one": "Extension installed", diff --git a/src/features/navigation-bar/NavigationBar.constants.ts b/src/features/navigation-bar/NavigationBar.constants.ts index 34d82f71..20999598 100644 --- a/src/features/navigation-bar/NavigationBar.constants.ts +++ b/src/features/navigation-bar/NavigationBar.constants.ts @@ -59,6 +59,18 @@ const NAVIGATION_BAR_BASE_ITEMS = [ IconComponent: ExploreOutlinedIcon, show: 'both', moreGroup: NavBarItemMoreGroup.GENERAL, + useBadge: () => { + const { t } = useTranslation(); + const { data } = requestManager.useGetExtensionList(); + + const extensions = data?.extensions.nodes ?? []; + const availableUpdates = extensions.filter((extension) => extension.hasUpdate).length; + + return { + count: availableUpdates, + title: t('extension.label.available_updates', { count: availableUpdates }), + }; + }, }, ] as const satisfies RestrictedNavBarItem<'both'>[];