mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 06:55:50 +00:00
fix(mobile): avoid crashing (#5109)
This commit is contained in:
parent
aa68a739c0
commit
db33645821
@ -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 {
|
||||
|
@ -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<string>(() => {
|
||||
return tabSchemaUid || activeTabBarItem?.children[0]?.schemaUid;
|
||||
return tabSchemaUid || activeTabBarItem?.children?.[0]?.schemaUid;
|
||||
});
|
||||
const handleChange: TabsProps['onChange'] = (schemaUid) => {
|
||||
setActiveKey(schemaUid);
|
||||
|
Loading…
Reference in New Issue
Block a user