fix: WebUI chat crashes on streaming reasoning — sendChat never passed the reason flag to addMsg, so .think/.tk-hint were null and first reasoning_content chunk threw 'Cannot set properties of null'; pass reason=true and hide the empty box until thinking arrives

This commit is contained in:
JianFeeeee
2026-08-11 09:52:12 +08:00
parent e8ef73321c
commit 7647b7dff8

View File

@ -963,10 +963,11 @@ async function sendChat() {
uimgBox.textContent = msg; uimgBox.textContent = msg;
} }
const arow = addMsg('assistant', ''); const arow = addMsg('assistant', '', true);
const abuf = arow.querySelector('.bmd'); const abuf = arow.querySelector('.bmd');
const thinkEl = arow.querySelector('.think'); const thinkEl = arow.querySelector('.think');
const hintEl = arow.querySelector('.tk-hint'); const hintEl = arow.querySelector('.tk-hint');
thinkEl.style.display = 'none';
const cursor = document.createElement('span'); cursor.className = 'cursor-dot'; const cursor = document.createElement('span'); cursor.className = 'cursor-dot';
abuf.appendChild(cursor); abuf.appendChild(cursor);