From 119aae76e5b26b1015e13a8acf285aba316d9f30 Mon Sep 17 00:00:00 2001 From: sudoer777 <78781902+sudoer777@users.noreply.github.com> Date: Tue, 7 Dec 2021 10:55:34 -0700 Subject: [PATCH] Display submitter name in admin panel for games submitted without account --- public/scripts/manage.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/public/scripts/manage.js b/public/scripts/manage.js index 2b958f9..a77a7d6 100644 --- a/public/scripts/manage.js +++ b/public/scripts/manage.js @@ -291,8 +291,13 @@ CATEGORIES.push(new Category( row.appendChild(dateCell); const submitterCell = document.createElement('td'); - Data.getAccount(game.submitterID) - .then(data => submitterCell.textContent = data.name); + if(game.submitterID) { + Data.getAccount(game.submitterID) + .then(data => submitterCell.textContent = data.name); + } else { + submitterCell.textContent = game.submitterName; + console.log(game.submitterName); + } row.appendChild(submitterCell); }, async function addGame() {