Merge pull request #49 from tresabhi/1.15.2

This commit is contained in:
TrèsAbhi authored and GitHub committed 2023-11-19 14:05:46 -06:00
commit bb1c0c7625
3 files changed
+13 -12

No files matched your search

+9
View File
@@ -0,0 +1,9 @@
# Blitzkrieg 1.15.2
Infinity reduced to a finite value.
## Fixes
- Added a maximum value to the jump to position button
- Removed neighbor checking for the seeding player
- This fixes the jump to position button not loading at all
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "blitzkrieg",
"version": "1.15.1",
"version": "1.15.2",
"description": "🎉 Tools for everything World of Tanks Blitz",
"main": "src/server.ts",
"type": "module",
+3 -11
View File
@@ -299,19 +299,11 @@ export default function Page() {
}
}
const seedingPlayerNeighborEntry = Object.entries(
leaderboard[region][season],
).find(([, player]) => id === player);
if (seedingPlayerNeighborEntry === undefined) return null;
// const seedingPlayerPosition = parseInt(seedingPlayerNeighborEntry[0]);
const { neighbors } = await getRatingsNeighbors(region, id, size, true);
useLeaderboardCache.setState(
produce((draft: LeaderboardCache) => {
neighbors.forEach((neighbor, neighborIndex) => {
// const position = neighborIndex - radius + seedingPlayerPosition;
const position = neighbor.number - 1;
if (!(position in draft[region][season])) {
@@ -347,9 +339,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) {