diff --git a/packages/core/client/src/schema-component/antd/page/PagePopups.tsx b/packages/core/client/src/schema-component/antd/page/PagePopups.tsx index 96c59bd0b6..3ac5ba667c 100644 --- a/packages/core/client/src/schema-component/antd/page/PagePopups.tsx +++ b/packages/core/client/src/schema-component/antd/page/PagePopups.tsx @@ -292,7 +292,7 @@ export const PagePopups = (props: { paramsList?: PopupParams[] }) => { setRootSchema(rootSchema); }; run(); - }, [fieldSchema.root, getPopupSchemaFromSchema, popupParams, requestSchema, savePopupSchemaToSchema]); + }, [fieldSchema, getPopupSchemaFromSchema, popupParams, requestSchema, savePopupSchemaToSchema]); const components = useMemo(() => ({ PagePopupsItemProvider }), []); @@ -444,7 +444,7 @@ function findSchemaByUid(uid: string, rootSchema: Schema, resultRef: { value: Sc resultRef = resultRef || { value: null, }; - rootSchema.mapProperties((schema) => { + rootSchema?.mapProperties?.((schema) => { if (schema['x-uid'] === uid) { resultRef.value = schema; } else { diff --git a/packages/plugins/@nocobase/plugin-mobile/src/client/pages/dynamic-page/header/tabs/MobilePageTabs.tsx b/packages/plugins/@nocobase/plugin-mobile/src/client/pages/dynamic-page/header/tabs/MobilePageTabs.tsx index 7e08e9cd35..b3ee591ead 100644 --- a/packages/plugins/@nocobase/plugin-mobile/src/client/pages/dynamic-page/header/tabs/MobilePageTabs.tsx +++ b/packages/plugins/@nocobase/plugin-mobile/src/client/pages/dynamic-page/header/tabs/MobilePageTabs.tsx @@ -7,16 +7,16 @@ * For more information, please refer to: https://www.nocobase.com/agreement. */ -import React, { FC, useCallback } from 'react'; import { Space, Tabs, TabsProps } from 'antd-mobile'; -import { useParams, useNavigate, Navigate } from 'react-router-dom'; +import React, { FC, useCallback } from 'react'; +import { Navigate, useNavigate, useParams } from 'react-router-dom'; -import { useMobileRoutes } from '../../../../mobile-providers'; import { DndContext, DndContextProps, Icon, SortableItem } from '@nocobase/client'; -import { useStyles } from './styles'; -import { MobilePageTabsSettings } from './settings'; -import { MobilePageTabInitializer } from './initializer'; +import { useMobileRoutes } from '../../../../mobile-providers'; import { useMobilePage } from '../../context'; +import { MobilePageTabInitializer } from './initializer'; +import { MobilePageTabsSettings } from './settings'; +import { useStyles } from './styles'; export const MobilePageTabs: FC = () => { const { activeTabBarItem, resource, refresh } = useMobileRoutes(); @@ -26,7 +26,7 @@ export const MobilePageTabs: FC = () => { const { styles } = useStyles(); const { tabSchemaUid } = useParams<{ tabSchemaUid: string }>(); const [activeKey, setActiveKey] = React.useState(() => { - return tabSchemaUid || activeTabBarItem?.children[0]?.schemaUid; + return tabSchemaUid || activeTabBarItem?.children?.[0]?.schemaUid; }); const handleChange: TabsProps['onChange'] = (schemaUid) => { setActiveKey(schemaUid);