Skip to content

Commit

Permalink
Merge pull request #25 from frudolph77/bugfix
Browse files Browse the repository at this point in the history
Bugfix
  • Loading branch information
alexander-zibert authored Feb 4, 2024
2 parents 0e92573 + 2be376c commit b224fba
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
14 changes: 6 additions & 8 deletions frontend/src/hooks/useCriteriaCard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,8 @@ export const criteriaCardPool: CriteriaCard[] = [
];

const getCardUrl = (card?: CriteriaCard, language?: string) =>
card && language
? `https://turingmachine.info/images/criteriacards/${language}/TM_GameCards_${language}-${(
"0" + card.id
).slice(-2)}.png`
card?.id && language
? `https://turingmachine.info/images/criteriacards/${language}/TM_GameCards_${language}-${("0" + card.id).slice(-2)}.png`
: "";

export const useCriteriaCard = (verifier: Verifier, index: number) => {
Expand All @@ -98,11 +96,11 @@ export const useCriteriaCard = (verifier: Verifier, index: number) => {
const dispatch = useAppDispatch();

const toggleCriteria = (criteria: number) => {
if (!card) return;
if ( !card ) return;

const criteriaIndex = card.irrelevantCriteria.indexOf(criteria);

if (criteriaIndex === -1) {
if ( criteriaIndex === -1 ) {
setCard({
...card,
irrelevantCriteria: [...card.irrelevantCriteria, criteria],
Expand All @@ -125,10 +123,10 @@ export const useCriteriaCard = (verifier: Verifier, index: number) => {
}, [card]);

const toggleLetter = (verifier: Verifier) => {
if (!letters) return;
if ( !letters ) return;
setLetters(
letters.map((letter: Letter) => {
if (letter.letter === verifier) {
if ( letter.letter === verifier ) {
return {
...letter,
isIrrelevant: !letter.isIrrelevant,
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/parsing/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export const CHECK_CARDS = [
],
[
202, 207, 216, 221, 228, 236, 247, 255, 263, 268, 277, 287, 294, 303, 311,
316, 324, 330, 335, 340, 347, 352, 357, 362, 372, 377, 382, 391, 393, 399,
316, 324, 330, 335, 340, 347, 352, 357, 362, 372, 377, 382, 389, 393, 399,
404, 409, 414, 421, 430, 435, 441, 449, 458, 463, 471, 476, 482, 486, 492,
498, 504, 509, 518, 527, 533, 540, 547, 553, 562, 567, 573, 579, 585, 589,
593, 597, 605, 610, 615, 621, 629, 633, 637, 641, 647, 651, 656, 662, 667,
Expand Down

0 comments on commit b224fba

Please sign in to comment.