mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
[FIX] playground: not all completed is deleted
Before this fix, not all completed tasks are deleted when clicking clear completed button because we are looping to a mutated array. Looping thru a copy of the mutated array fixes this problem.
This commit is contained in:
committed by
Géry Debongnie
parent
b7b0e38fca
commit
0c9c5b877b
@@ -455,7 +455,7 @@ const actions = {
|
||||
todo.completed = !todo.completed;
|
||||
},
|
||||
clearCompleted({ state, dispatch }) {
|
||||
for (let todo of state.todos) {
|
||||
for (let todo of state.todos.slice()) {
|
||||
if (todo.completed) {
|
||||
dispatch("removeTodo", todo.id);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user