mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 22:57:21 +01:00
11 lines
308 B
JavaScript
11 lines
308 B
JavaScript
import _ from 'lodash';
|
|
|
|
// TODO move to client since it's only used there?
|
|
// TODO rename file to clearCompletedTodos
|
|
|
|
module.exports = function clearCompletedTodos (todos) {
|
|
_.remove(todos, todo => {
|
|
return todo.completed && (!todo.challenge || !todo.challenge.id || todo.challenge.broken);
|
|
});
|
|
};
|