diff --git a/network-poc/static/index.html b/network-poc/static/index.html index 1c23e7e..9c975cc 100644 --- a/network-poc/static/index.html +++ b/network-poc/static/index.html @@ -3110,8 +3110,11 @@ ${generatedFiles['Dockerfile'] || '(puuttuu)'}`; while (term.children.length > 50 && !term.firstChild.querySelector('.stream-content')) term.removeChild(term.firstChild); term.scrollTop = term.scrollHeight; - document.querySelectorAll('.avatar-card').forEach(c => c.classList.remove('active')); - document.getElementById('avatar-kpn').classList.add('active'); + // Avatar-aktivointi vain oikeille käyttäjäpyynnöille + if (data.task_id) { + document.querySelectorAll('.avatar-card').forEach(c => c.classList.remove('active')); + document.getElementById('avatar-kpn')?.classList.add('active'); + } } } else if (isCoder) { // Codelab: erillinen addCodeResult-handler käsittelee (rivi 2364) @@ -3258,7 +3261,8 @@ ${generatedFiles['Dockerfile'] || '(puuttuu)'}`; term.scrollTop = term.scrollHeight; } - // Avatar-aktivointi vain omille tehtäville + // Avatar-aktivointi vain oikeille käyttäjäpyynnöille (task_id) + if (!data.task_id) break; document.querySelectorAll('.avatar-card').forEach(c => c.classList.remove('active')); const model = data.model || ''; const p = data.prompt ? data.prompt.toLowerCase() : '';