From da5851d4ce782c60c24ff96006fb44d5ea6c6f79 Mon Sep 17 00:00:00 2001 From: stonedDiscord Date: Sat, 9 Apr 2022 13:16:04 +0200 Subject: define demo at the beginning --- webAO/client.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/webAO/client.ts b/webAO/client.ts index d1a11a3..7df9133 100644 --- a/webAO/client.ts +++ b/webAO/client.ts @@ -911,9 +911,9 @@ class Client extends EventEmitter { * @param {Number} charid character ID */ async handleCharacterInfo(chargs: string[], charid: number) { + const img = document.getElementById(`demo_${charid}`); if (chargs[0]) { let cini: any = {}; - const img = document.getElementById(`demo_${charid}`); const getCharIcon = async () => { const extensions = [ '.png', @@ -986,7 +986,6 @@ class Client extends EventEmitter { iniedit_select.add(new Option(safeTags(chargs[0]))); } else { console.warn(`missing charid ${charid}`); - const img = document.getElementById(`demo_${charid}`); img.style.display = 'none'; } } -- cgit