fix: Save change in LocalStorage when you clear checked todos.

Ref: #10
This commit is contained in:
Lucàs
2024-05-04 16:50:41 +02:00
parent e50dc8dbac
commit 1469e46049
+1 -1
View File
@@ -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;
},
},