fix: collections undefined inuseCollectionState (#3741)

This commit is contained in:
katherinehhh 2024-03-17 22:16:11 +08:00 committed by GitHub
parent 93091a92f7
commit 7e32842a6d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View File

@ -193,7 +193,7 @@ export class InheritanceCollectionMixin extends Collection {
}; };
this.allCollectionsInheritChain = getInheritChain(this.name); this.allCollectionsInheritChain = getInheritChain(this.name);
return this.allCollectionsInheritChain; return this.allCollectionsInheritChain || [];
} }
getInheritCollectionsChain() { getInheritCollectionsChain() {

View File

@ -26,7 +26,7 @@ export const useCollectionState = (currentCollectionName: string) => {
const templateField: any = useField(); const templateField: any = useField();
function getCollectionList() { function getCollectionList() {
const collections = getAllCollectionsInheritChain(currentCollectionName); const collections = getAllCollectionsInheritChain(currentCollectionName) || [];
return collections.map((name) => ({ label: getCollection(name)?.title, value: name })); return collections.map((name) => ({ label: getCollection(name)?.title, value: name }));
} }