From 1469e460490b8b18c8066d6b3cba94825501e933 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luc=C3=A0s?= Date: Sat, 4 May 2024 16:50:41 +0200 Subject: [PATCH] fix: Save change in LocalStorage when you clear checked todos. Ref: #10 --- src/features/todo/todoSlice.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/features/todo/todoSlice.ts b/src/features/todo/todoSlice.ts index 9dde9bf..d05727b 100644 --- a/src/features/todo/todoSlice.ts +++ b/src/features/todo/todoSlice.ts @@ -32,7 +32,7 @@ export const todoSlice = createSlice({ }, deleteSelectedTodos: (state) => { const newState = state.filter((todo: TodoState) => !todo.checked); - localStorage.setItem('todos', JSON.stringify(state)); + localStorage.setItem('todos', JSON.stringify(newState)); return newState; }, },