mirror of
https://github.com/PeWu/topola-viewer.git
synced 2026-08-03 17:41:48 +00:00
WikiTree: display marriage info for ancestors
This commit is contained in:
@@ -100,10 +100,14 @@ export async function loadWikiTree(
|
|||||||
// Fetch the ancestors of the input person and ancestors of his/her spouses.
|
// Fetch the ancestors of the input person and ancestors of his/her spouses.
|
||||||
const firstPerson = await getRelatives([key], handleCors);
|
const firstPerson = await getRelatives([key], handleCors);
|
||||||
const spouseKeys = Object.values(firstPerson[0].Spouses).map((s) => s.Name);
|
const spouseKeys = Object.values(firstPerson[0].Spouses).map((s) => s.Name);
|
||||||
[key].concat(spouseKeys).forEach(async (personId) => {
|
const ancestors = await Promise.all(
|
||||||
const ancestors = await getAncestors(personId, handleCors);
|
[key]
|
||||||
everyone.push(...ancestors);
|
.concat(spouseKeys)
|
||||||
});
|
.map((personId) => getAncestors(personId, handleCors)),
|
||||||
|
);
|
||||||
|
const ancestorKeys = ancestors.flat().map((person) => person.Name);
|
||||||
|
const ancestorDetails = await getRelatives(ancestorKeys, handleCors);
|
||||||
|
everyone.push(...ancestorDetails);
|
||||||
|
|
||||||
// Fetch descendants recursively.
|
// Fetch descendants recursively.
|
||||||
let toFetch = [key];
|
let toFetch = [key];
|
||||||
|
|||||||
Reference in New Issue
Block a user