From 918f4115b18a7261ce7a3860e34984ac5b4b6e48 Mon Sep 17 00:00:00 2001 From: Liam Date: Mon, 30 Sep 2024 22:48:30 +0100 Subject: [PATCH] fix types and fix eslint err --- src/components/loaders/database-loader.tsx | 2 +- src/components/player/player-scores.tsx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/loaders/database-loader.tsx b/src/components/loaders/database-loader.tsx index 2e1a79e..41fd69a 100644 --- a/src/components/loaders/database-loader.tsx +++ b/src/components/loaders/database-loader.tsx @@ -23,7 +23,7 @@ export default function DatabaseLoader({ children }: Props) { setDatabase(db); console.log(`Loaded database in ${performance.now() - before}ms`); - db.on("ready", err => { + db.on("ready", () => { toast({ title: "Database loaded", description: "The database was loaded successfully.", diff --git a/src/components/player/player-scores.tsx b/src/components/player/player-scores.tsx index 22e6d3f..2a8f679 100644 --- a/src/components/player/player-scores.tsx +++ b/src/components/player/player-scores.tsx @@ -58,7 +58,7 @@ export default function PlayerScores({ initialScoreData, initialSearch, player, const [searchTerm, setSearchTerm] = useState(initialSearch || ""); const debouncedSearchTerm = useDebounce(searchTerm, 250); const [shouldFetch, setShouldFetch] = useState(false); // New state to control fetching - const topOfScoresRef = useRef(null); + const topOfScoresRef = useRef(null); const isSearchActive = debouncedSearchTerm.length >= 3; const { @@ -143,7 +143,7 @@ export default function PlayerScores({ initialScoreData, initialSearch, player, */ useEffect(() => { if (topOfScoresRef.current && shouldFetch) { - const topOfScoresPosition = (topOfScoresRef.current as any).getBoundingClientRect().top + window.scrollY; + const topOfScoresPosition = topOfScoresRef.current.getBoundingClientRect().top + window.scrollY; window.scrollTo({ top: topOfScoresPosition - 55, // Navbar height (plus some padding) behavior: "smooth",