diff --git a/chat.html b/chat.html index 0ca4e19..a2fa1c8 100644 --- a/chat.html +++ b/chat.html @@ -424,7 +424,7 @@ messages = []; try { sessionStorage.removeItem(STORAGE_KEY); } catch (e) { } welcome.style.display = ''; - countdownEl.textContent = '10:00'; + countdownEl.textContent = formatCountdown(SESSION_TIMEOUT_MS); countdownEl.classList.remove('session-warn'); addSystemPill('Your session timed out after 10 minutes of inactivity — this chat was cleared. Say hello to start a new one.'); chatScroll.scrollTop = chatScroll.scrollHeight; @@ -514,15 +514,16 @@ async function send(text) { const prompt = (text || '').trim(); - if (!prompt || generating || expired) return; + if (!prompt || generating) return; + if (expired) newChat(); // typing after a timeout seamlessly starts a fresh session hideWelcome(); - touchSession(); // User bubble const userBubble = addMessageRow('user'); userBubble.textContent = prompt; messages.push({ role: 'user', content: prompt }); + touchSession(); // persist the user message immediately, not only after the reply input.value = ''; autosize(); chatScroll.scrollTop = chatScroll.scrollHeight; diff --git a/index.html b/index.html index 07f6442..38e2ce9 100755 --- a/index.html +++ b/index.html @@ -1310,7 +1310,7 @@
How It Works - Moxie Demo + Moxie Demo - Moxie Demo