mirror of
https://github.com/PeWu/topola-viewer.git
synced 2026-08-04 18:11:49 +00:00
Don't link to spouses that don't have their records.
Don't show 'Unknown' in the name field.
This commit is contained in:
@@ -135,7 +135,9 @@ export async function loadWikiTree(id: string, handleCors: boolean) {
|
|||||||
}
|
}
|
||||||
converted.add(person.Id);
|
converted.add(person.Id);
|
||||||
gedcomLines.push(`0 @${idToName.get(person.Id)}@ INDI`);
|
gedcomLines.push(`0 @${idToName.get(person.Id)}@ INDI`);
|
||||||
gedcomLines.push(`1 NAME ${person.FirstName} /${person.LastNameAtBirth}/`);
|
const firstName = person.FirstName === 'Unknown' ? '' : person.FirstName;
|
||||||
|
const lastName = person.LastNameAtBirth === 'Unknown' ? '' : person.LastNameAtBirth;
|
||||||
|
gedcomLines.push(`1 NAME ${firstName} /${lastName}/`);
|
||||||
if (person.Mother || person.Father) {
|
if (person.Mother || person.Father) {
|
||||||
gedcomLines.push(`1 FAMC @${getFamilyId(person.Mother, person.Father)}@`);
|
gedcomLines.push(`1 FAMC @${getFamilyId(person.Mother, person.Father)}@`);
|
||||||
}
|
}
|
||||||
@@ -147,11 +149,13 @@ export async function loadWikiTree(id: string, handleCors: boolean) {
|
|||||||
|
|
||||||
spouses.forEach((value, key) => {
|
spouses.forEach((value, key) => {
|
||||||
gedcomLines.push(`0 @${key}@ FAM`);
|
gedcomLines.push(`0 @${key}@ FAM`);
|
||||||
if (value.wife) {
|
const wife = value.wife && idToName.get(value.wife);
|
||||||
gedcomLines.push(`1 WIFE @${idToName.get(value.wife)}@`);
|
if (wife) {
|
||||||
|
gedcomLines.push(`1 WIFE @${wife}@`);
|
||||||
}
|
}
|
||||||
if (value.husband) {
|
const husband = value.husband && idToName.get(value.husband);
|
||||||
gedcomLines.push(`1 HUSB @${idToName.get(value.husband)}@`);
|
if (husband) {
|
||||||
|
gedcomLines.push(`1 HUSB @${husband}@`);
|
||||||
}
|
}
|
||||||
getSet(children, key).forEach((child) => {
|
getSet(children, key).forEach((child) => {
|
||||||
gedcomLines.push(`1 CHIL @${idToName.get(child)}@`);
|
gedcomLines.push(`1 CHIL @${idToName.get(child)}@`);
|
||||||
|
|||||||
Reference in New Issue
Block a user