fix(bug): memory block bug

This commit is contained in:
Emir Karabeg
2025-02-16 16:22:25 -08:00
parent 2ba9998436
commit 472ea89282
2 changed files with 29 additions and 31 deletions

View File

@@ -10,9 +10,11 @@ import { useWorkflowStore } from './workflow/store'
* Reset all application stores to their initial state
*/
export const resetAllStores = () => {
// Clear localStorage first
// Selectively clear localStorage items
if (typeof window !== 'undefined') {
localStorage.clear()
const keysToKeep = ['next-favicon']
const keysToRemove = Object.keys(localStorage).filter((key) => !keysToKeep.includes(key))
keysToRemove.forEach((key) => localStorage.removeItem(key))
}
// Force immediate state reset for all stores