mirror of
https://gitee.com/nocobase/nocobase.git
synced 2024-12-05 13:47:45 +08:00
fix: undefined type in useDataBlockProps() (#5365)
This commit is contained in:
parent
0b863899bf
commit
55cdfadee7
@ -166,7 +166,7 @@ export const createSubmitActionSettings = new SchemaSettings({
|
||||
name: 'saveMode',
|
||||
Component: SaveMode,
|
||||
useVisible() {
|
||||
const { type } = useDataBlockProps();
|
||||
const { type } = useDataBlockProps() || ({} as any);
|
||||
return type !== 'publicForm';
|
||||
},
|
||||
},
|
||||
|
@ -27,7 +27,7 @@ const commonOptions = {
|
||||
title: '{{t("Custom request")}}',
|
||||
Component: 'CustomRequestInitializer',
|
||||
useVisible() {
|
||||
const { type } = useDataBlockProps();
|
||||
const { type } = useDataBlockProps() || ({} as any);
|
||||
return type !== 'publicForm';
|
||||
},
|
||||
},
|
||||
|
@ -359,7 +359,7 @@ export const selectComponentFieldSettings = new SchemaSettings({
|
||||
const isAssociationField = useIsAssociationField();
|
||||
const readPretty = useIsFieldReadPretty();
|
||||
const { fieldSchema } = useColumnSchema();
|
||||
const { type } = useDataBlockProps();
|
||||
const { type } = useDataBlockProps() || ({} as any);
|
||||
return isAssociationField && !fieldSchema && !readPretty && type !== 'publicForm';
|
||||
},
|
||||
},
|
||||
|
@ -107,7 +107,7 @@ export const useImportStartAction = () => {
|
||||
const { setVisible, fieldSchema } = useActionContext();
|
||||
const { setImportModalVisible, setImportStatus, setImportResult } = useImportContext();
|
||||
const { upload } = form.values;
|
||||
const dataBlockProps = useDataBlockProps();
|
||||
const dataBlockProps = useDataBlockProps() || ({} as any);
|
||||
const headers = useDataSourceHeaders(dataBlockProps.dataSource);
|
||||
useEffect(() => {
|
||||
form.reset();
|
||||
|
Loading…
Reference in New Issue
Block a user