refactor: association schemaInitialize

This commit is contained in:
katherinehhh 2023-05-08 13:38:30 +08:00
parent 4110601d8b
commit 2b5a566e58
2 changed files with 1 additions and 4 deletions

View File

@ -65,7 +65,6 @@ const InternalFileManager = (props) => {
const [selectedRows, setSelectedRows] = useState([]);
const insertSelector = useInsertSchema('Selector');
const fieldNames = useFieldNames(props);
console.log(fieldNames)
const field: any = useField();
const [options, setOptions] = useState([]);
const { getField } = useCollection();
@ -180,7 +179,6 @@ const FileManageReadPretty = connect((props) => {
const field: any = useField();
const { getField } = useCollection();
const collectionField = getField(field.props.name);
console.log(props)
return collectionField ? <Preview {...props} /> : null;
});

View File

@ -15,8 +15,7 @@ export const ReadPretty = (props) => {
const { getCollection } = useCollectionManager();
const collectionField = getField(field.props.name);
const isFileCollection = getCollection(collectionField?.target).template === 'file';
const [currentMode, setCurrentMode] = useState(props.mode || isFileCollection ? 'FileManager' : 'Select');
console.log(props)
const [currentMode, setCurrentMode] = useState(props.mode || (isFileCollection ? 'FileManager' : 'Select'));
useEffect(() => {
props.mode && setCurrentMode(props.mode);
}, [props.mode]);