From fe4532d7cd521091dfdcd8521b11109baadd14fb Mon Sep 17 00:00:00 2001 From: Liam Date: Wed, 11 Sep 2024 23:18:02 +0100 Subject: [PATCH] fix bsr copy --- src/components/input/pagination.tsx | 14 +++++++------- src/components/player/score/score.tsx | 4 +++- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/components/input/pagination.tsx b/src/components/input/pagination.tsx index e9dabcc..d6be48b 100644 --- a/src/components/input/pagination.tsx +++ b/src/components/input/pagination.tsx @@ -62,10 +62,10 @@ export default function Pagination({ mobilePagination, page, totalPages, onPageC if (startPage > 1 && !mobilePagination) { pageNumbers.push( <> - + handlePageChange(1)}>1 - + @@ -75,7 +75,7 @@ export default function Pagination({ mobilePagination, page, totalPages, onPageC // Generate page numbers between startPage and endPage for desktop view for (let i = startPage; i <= endPage; i++) { pageNumbers.push( - + handlePageChange(i)}> {i} @@ -90,7 +90,7 @@ export default function Pagination({ mobilePagination, page, totalPages, onPageC {/* Previous button for mobile and desktop */} - + handlePageChange(currentPage - 1)} /> @@ -100,16 +100,16 @@ export default function Pagination({ mobilePagination, page, totalPages, onPageC {!mobilePagination && currentPage < totalPages && ( <> - + - + handlePageChange(totalPages)}>{totalPages} )} {/* Next button for mobile and desktop */} - + handlePageChange(currentPage + 1)} /> diff --git a/src/components/player/score/score.tsx b/src/components/player/score/score.tsx index 9a2ce98..cb3bc85 100644 --- a/src/components/player/score/score.tsx +++ b/src/components/player/score/score.tsx @@ -1,5 +1,6 @@ "use client"; +import { copyToClipboard } from "@/common/browser-utils"; import { beatsaverFetcher } from "@/common/data-fetcher/impl/beatsaver"; import ScoreSaberPlayerScore from "@/common/data-fetcher/types/scoresaber/scoresaber-player-score"; import { formatNumberWithCommas } from "@/common/number-utils"; @@ -30,7 +31,7 @@ export default function Score({ playerScore }: Props) { const bsrFound = await beatsaverFetcher.getMapBsr(leaderboard.songHash); setBsr(bsrFound); })(); - }, [playerScore]); + }, [playerScore, leaderboard.songHash]); return (
@@ -68,6 +69,7 @@ export default function Score({ playerScore }: Props) { title: "Copied!", description: `Copied "!bsr ${bsr}" to your clipboard!`, }); + copyToClipboard(`!bsr ${bsr}`); }} tooltip={

Click to copy the bsr code

} >