fix: add max target position

This commit is contained in:
TrèsAbhi committed 2023-11-19 13:55:11 -06:00
1 parent 032d98e6bd
commit c1ecef0179
2 files changed
+4 -4

No files matched your search

+3 -3
View File
@@ -347,9 +347,9 @@ export default function Page() {
async function jumpToPosition(position: number) {
if (!ratingsInfo || ratingsInfo?.detail) return;
const targetPosition = Math.max(
0,
Math.min(position, ratingsInfo.count - 1),
const targetPosition = Math.min(
ratingsInfo.count - 1,
Math.max(0, Math.min(position, ratingsInfo.count - 1)),
);
if (season === 0) {