Skip to content

Commit

Permalink
Merge pull request #99 from karwosts/due-days-fix
Browse files Browse the repository at this point in the history
Fix show_days default behavior
  • Loading branch information
isabellaalstrom authored Apr 17, 2023
2 parents 8a157eb + 6c23e90 commit 7e5b95e
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions grocy-chores-card.js
Original file line number Diff line number Diff line change
Expand Up @@ -451,12 +451,15 @@ class GrocyChoresCard extends LitElement {
_isItemVisible(item) {
let visible = false;

visible = visible || (item.__due_in_days == null);
visible = visible && (item.__type === "chore" ? this.show_chores_without_due : true);
visible = visible && (item.__type === "task" ? this.show_tasks_without_due : true);

visible = visible || (item.__due_in_days < 0);
visible = visible || (item.__due_in_days <= this.show_days);
if(item.__due_in_days == null) {
visible = true;
visible = visible && (item.__type === "chore" ? this.show_chores_without_due : true);
visible = visible && (item.__type === "task" ? this.show_tasks_without_due : true);
} else {
visible = visible || this.show_days == null;
visible = visible || (item.__due_in_days < 0);
visible = visible || (item.__due_in_days <= this.show_days);
}

visible = visible && (this.filter !== undefined ? this._checkMatchNameFilter(item) : true);
visible = visible && (this.filter_user !== undefined ? this._checkMatchUserFilter(item) : true);
Expand Down

0 comments on commit 7e5b95e

Please sign in to comment.