diff --git a/client/packages/core/src/modules/portal-config/hooks/use-favorites.ts b/client/packages/core/src/modules/portal-config/hooks/use-favorites.ts index 65476490..1664be45 100644 --- a/client/packages/core/src/modules/portal-config/hooks/use-favorites.ts +++ b/client/packages/core/src/modules/portal-config/hooks/use-favorites.ts @@ -16,7 +16,7 @@ export const useFavorites = () => { const favorite$ = useMemo( () => combineLatest([app?.getAppManifests(), menuFavoritesController.favorites$]).pipe( - map(([apps, favorites]) => apps.filter((app) => favorites.includes(app.key!))) + map(([apps, favorites]) => apps.filter((app) => favorites.includes(app.key ?? ''))) ), [apps] ) as Observable; @@ -51,12 +51,13 @@ export const useFavorites = () => { ); const favoritesWithDisabled = - useMemo(() => favorites.map((p) => ({ ...p, isDisabled: isDisabled(p.key!) })), [favorites, isDisabled]) || []; + useMemo(() => favorites.map((p) => ({ ...p, isDisabled: isDisabled(p.key ?? '') })), [favorites, isDisabled]) || + []; const appGroupsWithPinned = useMemo(() => { return (appCategories || []).map((group) => ({ ...group, - apps: group.apps.map((app) => ({ ...app, isPinned: isPinned(app.key!) })), + apps: group.apps.map((app) => ({ ...app, isPinned: isPinned(app.key ?? '') })), })) as AppCategory[]; }, [isPinned, appCategories]); diff --git a/client/packages/core/src/modules/portal-config/utils/utils.ts b/client/packages/core/src/modules/portal-config/utils/utils.ts index 969e081c..496498ce 100644 --- a/client/packages/core/src/modules/portal-config/utils/utils.ts +++ b/client/packages/core/src/modules/portal-config/utils/utils.ts @@ -67,7 +67,7 @@ export function getPinnedAppsGroup(enabledApps: AppManifest[], disabledApps: App } as AppCategory ); - pinnedApps.apps.sort((a, b) => a.name!.localeCompare(b.name!)); + pinnedApps.apps.sort((a, b) => (a.name ?? '').localeCompare(b.name ?? '')); return pinnedApps; }