fix: clear localStorage when creating new session
- Added localStorage.removeItem(SESSION_STORAGE_KEY) to handleNewSession - Prevents old messages from reappearing after page refresh - New session now starts completely clean
This commit is contained in:
@@ -826,6 +826,9 @@ async function handleNewSession() {
|
||||
console.log('[handleNewSession] No current session or no messages to save')
|
||||
}
|
||||
|
||||
// Clear localStorage so old messages don't reappear on refresh
|
||||
localStorage.removeItem(SESSION_STORAGE_KEY)
|
||||
|
||||
// Create new session
|
||||
const now = new Date()
|
||||
const timeStr = `${now.getFullYear()}/${(now.getMonth()+1).toString().padStart(2,'0')}/${now.getDate().toString().padStart(2,'0')} ${now.getHours().toString().padStart(2,'0')}:${now.getMinutes().toString().padStart(2,'0')}`
|
||||
|
||||
Reference in New Issue
Block a user