Show available extension updates in navbar

This commit is contained in:
schroda
2025-08-18 22:52:28 +02:00
parent 11e98b6913
commit b81cc8ec17
2 changed files with 13 additions and 0 deletions

View File

@@ -281,6 +281,7 @@
"label": { "label": {
"add_repository_info": "You have to add a extension repository to be able to install extensions", "add_repository_info": "You have to add a extension repository to be able to install extensions",
"age_rating": "Age rating", "age_rating": "Age rating",
"available_updates": "{{count}} available updates",
"installation_failed_one": "Could not install the extension", "installation_failed_one": "Could not install the extension",
"installation_failed_other": "Could not install the extensions", "installation_failed_other": "Could not install the extensions",
"installed_successfully_one": "Extension installed", "installed_successfully_one": "Extension installed",

View File

@@ -59,6 +59,18 @@ const NAVIGATION_BAR_BASE_ITEMS = [
IconComponent: ExploreOutlinedIcon, IconComponent: ExploreOutlinedIcon,
show: 'both', show: 'both',
moreGroup: NavBarItemMoreGroup.GENERAL, 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'>[]; ] as const satisfies RestrictedNavBarItem<'both'>[];