chore: update 3 file(s)
This commit is contained in:
11
chatv2.js
11
chatv2.js
@@ -31,9 +31,9 @@ let chatHistory = JSON.parse(localStorage.getItem('chatHistory')) || [] // Store
|
||||
|
||||
// Ensure chatHistory is an array of objects with the correct structure
|
||||
chatHistory = chatHistory.map(message => ({
|
||||
role: message.role || 'user',
|
||||
content: message.content || '',
|
||||
markdown: message.markdown || false,
|
||||
role : message.role || 'user',
|
||||
content : message.content || '',
|
||||
markdown : message.markdown || false,
|
||||
messageId: message.messageId || `msg-${ Date.now() }`
|
||||
}))
|
||||
|
||||
@@ -614,8 +614,9 @@ window.onload = () => {
|
||||
// Load chat history from localStorage
|
||||
if (chatHistory.length === 0) {
|
||||
|
||||
// Add event listener for reset button
|
||||
document.getElementById('resetBtn').addEventListener('click', resetChat)
|
||||
// Add event listener for reset button
|
||||
document.getElementById('resetBtn').addEventListener('click', resetChat)
|
||||
}
|
||||
}
|
||||
|
||||
// Reset chat history
|
||||
|
||||
Reference in New Issue
Block a user