From 69c7448274de3407ba82602e92e3dd973121d618 Mon Sep 17 00:00:00 2001 From: Galla Date: Sun, 27 Oct 2024 20:03:06 -0400 Subject: [PATCH] Cleanup sonarqube issues --- app/Api/Profile.ts | 2 +- app/Api/Statistics.ts | 2 +- app/Components/SudokuBoard/SudokuBoard.tsx | 2 +- app/Functions/LocalDatabase.ts | 1 - app/Pages/Lesson.tsx | 6 +----- 5 files changed, 4 insertions(+), 9 deletions(-) diff --git a/app/Api/Profile.ts b/app/Api/Profile.ts index 3699ee7a..49dcaa0e 100644 --- a/app/Api/Profile.ts +++ b/app/Api/Profile.ts @@ -28,7 +28,7 @@ export const getProfile = async (): Promise => { }; if (value == null) { - await setProfile(defaultProfileValues); + setProfile(defaultProfileValues); return defaultProfileValues; } diff --git a/app/Api/Statistics.ts b/app/Api/Statistics.ts index b0d7a819..e4fb4c89 100644 --- a/app/Api/Statistics.ts +++ b/app/Api/Statistics.ts @@ -48,7 +48,7 @@ export const getStatistics = async (): Promise => { numHintsUsed: 0, numWrongCellsPlayed: 0, }; - await saveStatisitics(statistics); + saveStatisitics(statistics); return statistics; } return value; diff --git a/app/Components/SudokuBoard/SudokuBoard.tsx b/app/Components/SudokuBoard/SudokuBoard.tsx index 1ae8740c..adafa30c 100644 --- a/app/Components/SudokuBoard/SudokuBoard.tsx +++ b/app/Components/SudokuBoard/SudokuBoard.tsx @@ -4,6 +4,7 @@ import { finishSudokuGame, handlePause, saveGame, + isValueCorrect, } from "./Functions/BoardFunctions"; import { areCellsInSameBox, @@ -13,7 +14,6 @@ import { } from "./sudoku"; import { ActivityIndicator } from "react-native-paper"; import NumberControl from "./Components/NumberControl"; -import { isValueCorrect } from "./Functions/BoardFunctions"; import Cell from "./Components/Cell"; import ActionRow from "./Components/ActionRow"; import { generateGame } from "./Functions/generateGame"; diff --git a/app/Functions/LocalDatabase.ts b/app/Functions/LocalDatabase.ts index 3b3318de..f2c3ee5c 100644 --- a/app/Functions/LocalDatabase.ts +++ b/app/Functions/LocalDatabase.ts @@ -1,4 +1,3 @@ -import { SudokuStrategy } from "sudokuru"; import { GameDifficulty } from "../Components/SudokuBoard/Functions/Difficulty"; import { Puzzle } from "../Api/Puzzle.Types"; diff --git a/app/Pages/Lesson.tsx b/app/Pages/Lesson.tsx index 527b992b..69ce5890 100644 --- a/app/Pages/Lesson.tsx +++ b/app/Pages/Lesson.tsx @@ -49,15 +49,11 @@ const Lesson = (props: { route: { params: { params: any } } }) => { }, []) ); - async function saveUserLearnedLessons(learnedLessons: string[]) { - await saveLearnedLessons(learnedLessons); - } - const clickCheckMark = () => { if (!learnedLessons.includes(name)) { learnedLessons.push(name); updateLearnedLessons(learnedLessons); - saveUserLearnedLessons(learnedLessons); + saveLearnedLessons(learnedLessons); } navigation.navigate("LearnPage"); };