mirror of
https://github.com/LucasVbr/todo-list.git
synced 2026-05-13 17:22:04 +00:00
fix: Save change in LocalStorage when you clear checked todos.
Ref: #10
This commit is contained in:
@@ -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;
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user