mirror of
https://github.com/PeWu/topola-viewer.git
synced 2026-03-12 10:33:45 +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)
|
||||
.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);
|
||||
everyone.push(...ancestorDetails);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user