mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 13:16:08 +00:00
fix: add new blocks
This commit is contained in:
parent
5769925757
commit
3904aa7c11
@ -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) && (
|
||||||
|
Loading…
Reference in New Issue
Block a user