diff --git a/apps/thu-info-app/src/ui/home/home.tsx b/apps/thu-info-app/src/ui/home/home.tsx index 1a6b778fe..16c9bc70d 100644 --- a/apps/thu-info-app/src/ui/home/home.tsx +++ b/apps/thu-info-app/src/ui/home/home.tsx @@ -62,7 +62,7 @@ import { import IconNetwork from "../../assets/icons/IconNetwork"; import IconNetworkDetail from "../../assets/icons/IconNetworkDetail"; import IconNetworkOnlineDevices from "../../assets/icons/IconNetworkOnlineDevices"; -import IconCalendar from "../../assets/icons/IconCalendar"; +// import IconCalendar from "../../assets/icons/IconCalendar"; import {setBalance} from "../../redux/slices/campusCard"; import {gt} from "semver"; import VersionNumber from "react-native-version-number"; @@ -864,16 +864,16 @@ const getHomeFunctions = ( }}> , - { - addUsageStat(FunctionType.SchoolCalendar); - updateTop5("schoolCalendar"); - navigation.navigate("SchoolCalendar"); - }}> - - , + // { + // addUsageStat(FunctionType.SchoolCalendar); + // updateTop5("schoolCalendar"); + // navigation.navigate("SchoolCalendar"); + // }}> + // + // , ]; export const HomeScreen = ({navigation}: {navigation: RootNav}) => { @@ -887,17 +887,13 @@ export const HomeScreen = ({navigation}: {navigation: RootNav}) => { const disabledList: HomeFunction[] | undefined = useSelector( (state: State) => state.config.homeFunctionDisabled, ); - const sunsetFunctions: HomeFunction[] = ["expenditure"]; + if (!disabledList) { dispatch(configSet({key: "homeFunctionDisabled", value: []})); - } else if (sunsetFunctions.some((f) => !disabledList.includes(f))) { - dispatch( - configSet({ - key: "homeFunctionDisabled", - value: disabledList.concat(sunsetFunctions), - }), - ); } + + const sunsetFunctions: HomeFunction[] = ["expenditure", "schoolCalendar"]; + const homeFunctions = getHomeFunctions(navigation, (func) => dispatch(top5Update(func)), ); @@ -941,12 +937,12 @@ export const HomeScreen = ({navigation}: {navigation: RootNav}) => { needToShowFunctionNames.push("network"); } - if (!(disabledList ?? []).includes("schoolCalendar" as HomeFunction)) { - needToShowFunctionNames.push("schoolCalendar" as HomeFunction); - } + // if (!(disabledList ?? []).includes("schoolCalendar" as HomeFunction)) { + // needToShowFunctionNames.push("schoolCalendar" as HomeFunction); + // } const top5Filtered = top5.filter( - (f) => !(disabledList ?? []).includes((f as any).key), + (f) => !(disabledList ?? []).includes((f as any).key) && !sunsetFunctions.includes((f as any).key), ); const needToShowFunctions = needToShowFunctionNames.map((x) => @@ -968,7 +964,8 @@ export const HomeScreen = ({navigation}: {navigation: RootNav}) => { invalidHelper.twoFactorMethodHook = async () => { dispatch(configSet({key: "fingerprintSecure", value: true})); return undefined; - } + }; + helper .appStartUp(Platform.OS) .then(