From 4916130fb973243d39220a7ba8d0447f31f4ca91 Mon Sep 17 00:00:00 2001 From: Vicente Date: Tue, 13 Feb 2024 16:27:56 -0300 Subject: [PATCH] chore: tslint 'fix' in tutorial (#235) --- packages/frontend/src/api/hooks/useTutorial.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/frontend/src/api/hooks/useTutorial.ts b/packages/frontend/src/api/hooks/useTutorial.ts index ee9855ca..2163e533 100644 --- a/packages/frontend/src/api/hooks/useTutorial.ts +++ b/packages/frontend/src/api/hooks/useTutorial.ts @@ -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"; @@ -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] }) @@ -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}`, },