fix types and fix eslint err
Some checks failed
Deploy / deploy (push) Has been cancelled

This commit is contained in:
Lee 2024-09-30 22:48:30 +01:00
parent 4c654ca79a
commit 918f4115b1
2 changed files with 3 additions and 3 deletions

View File

@ -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.",

View File

@ -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<HTMLDivElement>(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",