mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-21 18:57:03 +02:00
fix: no existing cache overwrites for neighbors
This commit is contained in:
1 parent
e79c4a1e3f
commit
ca8dd5a702
1 file changed
+9
-5
@@ -282,10 +282,14 @@ export default function Page() {
|
||||
usePlayersCache.setState(
|
||||
produce((draft: PlayersCache) => {
|
||||
neighbors.forEach((neighbor) => {
|
||||
draft[region][season][neighbor.number - 1] = {
|
||||
id: neighbor.spa_id,
|
||||
score: neighbor.score,
|
||||
} satisfies BlitzkriegRatingsLeaderboardEntry;
|
||||
const position = neighbor.number - 1;
|
||||
|
||||
if (!(position in draft[region][season])) {
|
||||
draft[region][season][position] = {
|
||||
id: neighbor.spa_id,
|
||||
score: neighbor.score,
|
||||
} satisfies BlitzkriegRatingsLeaderboardEntry;
|
||||
}
|
||||
});
|
||||
}),
|
||||
);
|
||||
@@ -642,7 +646,7 @@ export default function Page() {
|
||||
});
|
||||
cacheNeighbors(
|
||||
players[region][season][position].id,
|
||||
ROWS_PER_PAGE * 3,
|
||||
4 * ROWS_PER_PAGE - 2,
|
||||
);
|
||||
}
|
||||
} else {
|
||||
|
||||
Reference in new issue
Block a user