Merge pull request #3512 from nickofolas/fix/stats-page-bn-level

MISC: Update logic for stats page BitNode level
This commit is contained in:
hydroflame 2022-04-19 11:09:31 -04:00 committed by GitHub
commit 81a4f42bf0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -82,13 +82,12 @@ function CurrentBitNode(): React.ReactElement {
const player = use.Player();
if (player.sourceFiles.length > 0) {
const index = "BitNode" + player.bitNodeN;
const currentSourceFile = player.sourceFiles.find((sourceFile) => sourceFile.n == player.bitNodeN);
const lvl = currentSourceFile ? currentSourceFile.lvl : 0;
const lvl = player.sourceFileLvl(player.bitNodeN) + 1;
return (
<Box>
<Paper sx={{ p: 1 }}>
<Typography variant="h5">
BitNode {player.bitNodeN}: {BitNodes[index].name} (Level {lvl + 1})
BitNode {player.bitNodeN}: {BitNodes[index].name} (Level {lvl})
</Typography>
<Typography sx={{ whiteSpace: "pre-wrap", overflowWrap: "break-word" }}>{BitNodes[index].info}</Typography>
</Paper>