fix: add new blocks

This commit is contained in:
chenos 2023-03-05 11:59:08 +08:00
parent 5769925757
commit 3904aa7c11

View File

@ -55,10 +55,13 @@ export const FormBlockProvider = (props) => {
const { __collection } = record; const { __collection } = record;
const currentCollection = useCollection(); const currentCollection = useCollection();
const { designable } = useDesignable(); const { designable } = useDesignable();
let detailFlag = true; let detailFlag = false;
if (Object.keys(record).length > 0) {
detailFlag = true;
if (!designable && __collection) { if (!designable && __collection) {
detailFlag = __collection === collection; detailFlag = __collection === collection;
} }
}
const createFlag = (currentCollection.name === collection && !Object.keys(record).length) || !currentCollection.name; const createFlag = (currentCollection.name === collection && !Object.keys(record).length) || !currentCollection.name;
return ( return (
(detailFlag || createFlag) && ( (detailFlag || createFlag) && (