From 02a26109c0fb84b428215511b694a273f3df72da Mon Sep 17 00:00:00 2001 From: modeco80 Date: Mon, 25 Nov 2024 16:57:13 -0500 Subject: [PATCH] webapp: Fix the testbed Show animation was removed from the web show() function. --- webapp/src/ts/testbed.ts | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/webapp/src/ts/testbed.ts b/webapp/src/ts/testbed.ts index 915d5d1..37ad034 100644 --- a/webapp/src/ts/testbed.ts +++ b/webapp/src/ts/testbed.ts @@ -22,6 +22,7 @@ input.addEventListener('change', async () => { agent.addToDom(mount); agent.show(); + await agent.playAnimationByNamePromise("Show"); console.log('Agent created'); }); @@ -31,13 +32,15 @@ document.addEventListener('DOMContentLoaded', async () => { }); let form = document.getElementById('acsUrlForm') as HTMLFormElement; -form.addEventListener('submit', (e) => { +form.addEventListener('submit', async (e) => { e.preventDefault(); let url = (document.getElementById('acsUrl') as HTMLInputElement).value; - msagent.agentCreateCharacterFromUrl(url).then((agent) => { - w.agents.push(agent); - agent.addToDom(document.body); - agent.show(); - console.log(`Loaded agent from ${url}`); - }); + let agent = await msagent.agentCreateCharacterFromUrl(url) + w.agents.push(agent); + agent.addToDom(document.body); + + agent.show(); + await agent.playAnimationByNamePromise("Show"); + + console.log(`Loaded agent from ${url}`); });