From 169b5dce92010fc66ae5dd0ff67ab39685ada416 Mon Sep 17 00:00:00 2001 From: lowercasedonkey <lowercasedonkey@gmail.com> Date: Tue, 15 Dec 2020 11:11:21 -0500 Subject: [PATCH] improve children display --- src/npc/startingGirls/editFamily.js | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/npc/startingGirls/editFamily.js b/src/npc/startingGirls/editFamily.js index 8a8c0f14543..40522e45870 100644 --- a/src/npc/startingGirls/editFamily.js +++ b/src/npc/startingGirls/editFamily.js @@ -261,10 +261,13 @@ App.Intro.editFamily = function(slave) { const div = document.createElement("div"); const linkArray = []; - div.append(`${slave.slaveName} is the mother of these children: `); - + const children = App.StartingGirls.listOfSlavesWithParent("mother", slave.ID); const nameEl = makeElWithID("motheredNames", "span"); - nameEl.append(App.StartingGirls.listOfSlavesWithParent("mother", slave.ID) || "None.", " "); + if (children) { + nameEl.append(`${slave.slaveName} is the mother of these children: ${children}. Add: `); + } else { + nameEl.append(`${slave.slaveName} is not a mother to any children yet. Add: `); + } div.append(nameEl); linkArray.push( @@ -328,10 +331,13 @@ App.Intro.editFamily = function(slave) { const div = document.createElement("div"); const linkArray = []; - div.append(`${slave.slaveName} is the father of these children: `); - + const children = App.StartingGirls.listOfSlavesWithParent("father", slave.ID); const nameEl = makeElWithID("fatheredNames", "span"); - nameEl.append(App.StartingGirls.listOfSlavesWithParent("father", slave.ID) || "None.", " "); + if (children) { + nameEl.append(`${slave.slaveName} is the father of these children: ${children}. Add: `); + } else { + nameEl.append(`${slave.slaveName} is not a father to any children yet. Add: `); + } div.append(nameEl); linkArray.push( -- GitLab