From 65e1f8c898445e3b573262f05d40ba22264d0fd7 Mon Sep 17 00:00:00 2001 From: itschip Date: Wed, 1 May 2024 18:21:39 +0200 Subject: [PATCH] fix(apps/phone): disabling apps --- apps/phone/src/os/apps/hooks/useApps.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/apps/phone/src/os/apps/hooks/useApps.tsx b/apps/phone/src/os/apps/hooks/useApps.tsx index 95b4fc610..e3e96b20b 100644 --- a/apps/phone/src/os/apps/hooks/useApps.tsx +++ b/apps/phone/src/os/apps/hooks/useApps.tsx @@ -6,11 +6,13 @@ import { SvgIconComponent } from '@mui/icons-material'; import { useTheme } from '@mui/material'; import { useSettingsValue } from '../../../apps/settings/hooks/useSettings'; import { IconSetObject } from '@typings/settings'; +import { usePhone } from '@os/phone/hooks'; export const useApps = () => { const { icons } = useNotifications(); const theme = useTheme(); const curIconSet = useSettingsValue().iconSet.value as IconSetObject; + const { ResourceConfig } = usePhone(); const apps: IApp[] = useMemo(() => { return APPS.map((app) => { @@ -38,7 +40,7 @@ export const useApps = () => { ), icon: , - isDisabled: app.disable, + isDisabled: !!ResourceConfig?.disabledApps.find((a) => a === app.id), }; } @@ -47,10 +49,10 @@ export const useApps = () => { notification: icons.find((i) => i.key === app.id), NotificationIcon, notificationIcon: , - isDisabled: app.disable, + isDisabled: !!ResourceConfig?.disabledApps.find((a) => a === app.id), }; }); - }, [icons, curIconSet, theme]); + }, [icons, curIconSet, theme, ResourceConfig]); const allApps = useMemo(() => [...apps], [apps]); const getApp = useCallback(