mirror of
https://github.com/PeWu/topola-viewer.git
synced 2026-08-02 17:11:48 +00:00
Filter out undefined in some cases
This commit is contained in:
@@ -143,7 +143,10 @@ export async function loadWikiTree(key: string): Promise<TopolaData> {
|
|||||||
.concat(spouseKeys)
|
.concat(spouseKeys)
|
||||||
.map((personId) => getAncestors(personId, handleCors)),
|
.map((personId) => getAncestors(personId, handleCors)),
|
||||||
);
|
);
|
||||||
const ancestorKeys = ancestors.flat().map((person) => person.Name);
|
const ancestorKeys = ancestors
|
||||||
|
.flat()
|
||||||
|
.map((person) => person.Name)
|
||||||
|
.filter((key) => !!key);
|
||||||
const ancestorDetails = await getRelatives(ancestorKeys, handleCors);
|
const ancestorDetails = await getRelatives(ancestorKeys, handleCors);
|
||||||
everyone.push(...ancestorDetails);
|
everyone.push(...ancestorDetails);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user