Skip to content

Commit

Permalink
chore: tslint 'fix' in tutorial (#235)
Browse files Browse the repository at this point in the history
  • Loading branch information
v-almonacid authored Feb 13, 2024
1 parent df695e0 commit 4916130
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/frontend/src/api/hooks/useTutorial.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// @ts-nocheck we'll fix this later: // TODO
import { useCallback } from "react";
import { setCurrentTutorialTip, setStoreShowTutorial } from "src/api/store";
import { useAppSelector, useAppDispatch } from "src/api/store/hooks";
Expand Down Expand Up @@ -51,7 +50,9 @@ export const useTutorial: () => ITutorial = () => {
.map((object) => object.id)
.indexOf(currentTutorialTip.id);
const next =
index !== undefined ? (index + 1) % allowedTutorials.length : 0;
typeof index === "number"
? (index + 1) % allowedTutorials.length
: 0;

dispatch(
setCurrentTutorialTip({ tutorialTip: allowedTutorials[next] })
Expand Down Expand Up @@ -116,7 +117,8 @@ export const useTutorial: () => ITutorial = () => {
// The last tip doesn't include a count
tipCount: `${
currentTutorialTip
? allowedTutorials.indexOf(currentTutorialTip) + 1
? // eslint-disable-next-line @typescript-eslint/restrict-plus-operands
allowedTutorials.indexOf(currentTutorialTip) + 1
: 1
}/${tutorials.length - 1}`,
},
Expand Down

0 comments on commit 4916130

Please sign in to comment.