Fix: Filter system messages when loading from localStorage to handle legacy data
This commit is contained in:
parent
f13fc85d21
commit
340241c886
1 changed files with 2 additions and 1 deletions
|
|
@ -20,7 +20,8 @@ export function loadConversationHistory() {
|
|||
if (saved) {
|
||||
try {
|
||||
const parsedHistory = JSON.parse(saved);
|
||||
return parsedHistory;
|
||||
// Filter out any system messages that might have been saved before our fix
|
||||
return parsedHistory.filter(msg => msg.role !== 'system');
|
||||
} catch (e) {
|
||||
console.error('Error parsing conversation history:', e);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue