Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Haxxer committed Nov 29, 2023
1 parent 6abe874 commit 8071517
Show file tree
Hide file tree
Showing 2 changed files with 325 additions and 312 deletions.
7 changes: 5 additions & 2 deletions src/helpers/pile-utilities.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,15 +187,18 @@ export function getItemPileTokens(filter = false) {
const validTokensOnScenes = allTokensOnScenes.map(([scene, tokens]) => [
scene,
tokens.filter((token) => {
return filter ? filter(token) : true;
return filter ? !filter(token) : true;
})
]).filter(([_, tokens]) => tokens.length);

const mappedValidTokens = Object.fromEntries(validTokensOnScenes);

const invalidTokensOnScenes = allTokensOnScenes.map(([scene, tokens]) => [
scene,
tokens.filter(token => {
if (mappedValidTokens[scene.id] && mappedValidTokens[scene.id].includes(token)) return false;
try {
return filter ? !filter(token) : false;
return filter ? filter(token) : false;
} catch (err) {
return true;
}
Expand Down
Loading

0 comments on commit 8071517

Please sign in to comment.