diff --git a/templates/index.html b/templates/index.html index b31832e..0256ffe 100644 --- a/templates/index.html +++ b/templates/index.html @@ -1433,7 +1433,7 @@ function appendMessage(role, content, animate, isSearch = false, afterEl = null) const months = ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec']; const ms = now.getMilliseconds(); const timeStr = months[now.getMonth()] + ' ' + String(now.getDate()).padStart(2,'0') + ', ' + now.getFullYear() + ' ' + String(now.getHours()).padStart(2,'0') + ':' + String(now.getMinutes()).padStart(2,'0') + ':' + String(now.getSeconds()).padStart(2,'0') + '.' + String(Math.floor(ms / 10)).padStart(2,'0'); - div.innerHTML = `
${role === 'user' ? 'YOU' : 'AI'}
${role}${role === 'user' ? ' ' + timeStr + '' : ''}
${content ? renderMarkdown(content) : ''}
${role === 'assistant' ? '
' : ''}
`; + div.innerHTML = `
${role === 'user' ? 'YOU' : 'AI'}
${role}${role === 'user' ? ' ' + timeStr + '' : ''}
${content ? renderMarkdown(content) : ''}
`; if (role === 'user') { const pair = document.createElement('div'); pair.className = 'msg-pair' + (isSearch ? ' search-pair' : ''); @@ -1449,7 +1449,7 @@ function appendMessage(role, content, animate, isSearch = false, afterEl = null) } else { container.prepend(div); } - if (content && role === 'assistant') { addCopyButtons(div); addMessageToolbar(div); } + if (content) { addCopyButtons(div); addMessageToolbar(div); } scrollToTop(); return div; }