Skip to content

Commit

Permalink
Return result of filterFn
Browse files Browse the repository at this point in the history
  • Loading branch information
treyturner committed Dec 31, 2023
1 parent 1cb5333 commit c13bf15
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions sanitize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,11 @@ async function sanitizeHistory() {
if (typeof history === 'object' && history !== null && history.slots.length) {
lastHistoryUpdate = history.last_history_update;
const filterFn = (i: Item) => {
['Completed', 'Failed'].includes(i.status) &&
return (
['Completed', 'Failed'].includes(i.status) &&
(config.categories.includes(i.category) ||
config.categories.some((c) => i.name.toLowerCase().includes(c)));
config.categories.some((c) => i.name.toLowerCase().includes(c)))
);
};
const items = history.slots.filter((i) => filterFn(i));
if (items.length) {
Expand Down

0 comments on commit c13bf15

Please sign in to comment.