Skip to content

Commit a4f1a00

Browse files
authored
Merge pull request #1241 from isaacphysics/improvement/code-scanning-useless-code-2024
Remove useless code detected by ESLint
2 parents 82b9ca9 + 724a8a8 commit a4f1a00

File tree

5 files changed

+4
-12
lines changed

5 files changed

+4
-12
lines changed

src/app/components/content/IsaacGlossaryTerm.tsx

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ import React, {Ref} from 'react';
22
import {Col, Row} from "reactstrap";
33
import {GlossaryTermDTO} from "../../../IsaacApiTypes";
44
import {IsaacContent} from "./IsaacContent";
5-
import {isAda, isDefined, TAG_ID, tags} from "../../services";
6-
import {Tag} from '../../../IsaacAppTypes';
75
import {formatGlossaryTermId} from "../pages/Glossary";
86

97
interface IsaacGlossaryTermProps {
@@ -13,11 +11,6 @@ interface IsaacGlossaryTermProps {
1311
}
1412

1513
const IsaacGlossaryTermComponent = ({doc, inPortal, linkToGlossary}: IsaacGlossaryTermProps, ref: Ref<any>) => {
16-
let _tags: Tag[] = [];
17-
if (isAda && doc.tags) {
18-
_tags = doc.tags.map(id => tags.getById(id as TAG_ID)).filter(tag => isDefined(tag));
19-
}
20-
2114
const termContents = <>
2215
<Col md={3} className="glossary_term_name">
2316
<p ref={ref}>
@@ -31,7 +24,6 @@ const IsaacGlossaryTermComponent = ({doc, inPortal, linkToGlossary}: IsaacGlossa
3124
</Col>
3225
<Col md={7}>
3326
{doc.explanation && <IsaacContent doc={doc.explanation} />}
34-
{/* {_tags && _tags.length > 0 && <p className="topics">Used in: {_tags.map(tag => tag.title).join(', ')}</p>} */}
3527
</Col>
3628
</>;
3729

src/app/components/elements/inputs/UserEmailPreferencesInput.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ export const UserEmailPreferencesInput = ({emailPreferences, setEmailPreferences
6767
/>
6868
</td>
6969
</tr>
70-
{isPhy && <tr>
70+
{<tr>
7171
<td className="form-required">Events</td>
7272
<td className="d-none d-sm-table-cell">
7373
{isaacEmailPreferenceDescriptions.events}

src/app/components/pages/Equality.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ const Equality = withRouter(({location}: RouteComponentProps<{}, {}, {board?: st
350350
<pre>{currentAttemptValue?.result?.uniqueSymbols}</pre>
351351
{(segueEnvironment === "DEV" || isStaff(user)) && <>
352352
<h4>Inequality seed</h4>
353-
<pre>{currentAttemptValue && currentAttemptValue.symbols && JSON.stringify(currentAttemptValue.symbols)}</pre>
353+
<pre>{currentAttemptValue.symbols && JSON.stringify(currentAttemptValue.symbols)}</pre>
354354
</>}
355355
</Col>
356356
</Row>}

src/app/components/pages/Gameboard.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ const GameboardItemComponent = ({gameboard, question}: {gameboard: GameboardDTO,
100100
<Markup encoding={"latex"} className={classNames( "question-link-title", {"text-secondary": isPhy})}>
101101
{generateQuestionTitle(question)}
102102
</Markup>
103-
{isPhy && message && <span className={"gameboard-item-message" + (isPhy ? "-phy " : " ") + messageClasses}>{message}</span>}
103+
{isPhy && message && <span className={classNames("gameboard-item-message-phy", messageClasses)}>{message}</span>}
104104
{isPhy && question.subtitle && <div className="small text-muted d-none d-sm-block">
105105
{question.subtitle}
106106
</div>}

src/app/services/userViewingContext.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ export function determineAudienceViews(audience?: AudienceContext[], creationCon
307307
viewsFilteredByCreationContext = allViews.filter(viewingContext => {
308308
let viableView = true;
309309
if (creationContext.stage && viewingContext.stage) {
310-
viableView = viableView && creationContext.stage.includes(viewingContext.stage);
310+
viableView = creationContext.stage.includes(viewingContext.stage);
311311
}
312312
if (creationContext.examBoard && viewingContext.examBoard) {
313313
viableView = viableView && creationContext.examBoard.includes(viewingContext.examBoard);

0 commit comments

Comments
 (0)