Skip to content

Commit f8f929f

Browse files
committed
small refactoring
1 parent ccca105 commit f8f929f

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

src/app/store/features/dividers/arkhamesque/criteria.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,12 @@ export const hasArkhamesqueInvestigatorSupport = ({
4747
return false;
4848
}
4949

50-
return (
51-
story.investigators.filter(({ code, alternate_of }) =>
52-
investigators.includes(alternate_of || code),
53-
).length > 0
54-
);
50+
const supportedInvestigators = story.investigators
51+
.filter(({ code, alternate_of }) =>
52+
investigators.includes(code) || (
53+
alternate_of && investigators.includes(alternate_of)
54+
),
55+
);
56+
57+
return supportedInvestigators.length > 0;
5558
};

src/shared/lib/hooks/stories/useLayoutSupport.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,10 @@ export const useLayoutSupport = () => {
4848
}
4949

5050
if (type === LayoutType.INVESTIGATOR) {
51-
const investigators = arkhamesqueData.investigators.flatMap((category) =>
52-
category.data.map(prop("code")),
51+
const investigators = arkhamesqueData.investigators.flatMap(
52+
category => category.data.map(
53+
prop("code")
54+
)
5355
);
5456

5557
return hasArkhamesqueInvestigatorSupport({

0 commit comments

Comments
 (0)