From d43ec1d501ba5dd5a45c968aa5222ab7f8e6bde4 Mon Sep 17 00:00:00 2001 From: nickofolas Date: Sat, 7 May 2022 16:19:31 -0500 Subject: [PATCH] Fix computation of BN level --- src/BitNode/ui/BitnodeMultipliersDescription.tsx | 10 +++++----- src/BitNode/ui/PortalModal.tsx | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/BitNode/ui/BitnodeMultipliersDescription.tsx b/src/BitNode/ui/BitnodeMultipliersDescription.tsx index d01f182f4..addd52418 100644 --- a/src/BitNode/ui/BitnodeMultipliersDescription.tsx +++ b/src/BitNode/ui/BitnodeMultipliersDescription.tsx @@ -12,10 +12,10 @@ import { IBitNodeMultipliers } from "../BitNodeMultipliers"; interface IProps { n: number; - showNext?: boolean; + level?: number; } -export function BitnodeMultiplierDescription({ n, showNext = false }: IProps): React.ReactElement { +export function BitnodeMultiplierDescription({ n, level }: IProps): React.ReactElement { const [open, setOpen] = React.useState(false); if (n === 1) return <>; @@ -26,15 +26,15 @@ export function BitnodeMultiplierDescription({ n, showNext = false }: IProps): R {open ? : } - + ); } -export const BitNodeMultipliersDisplay = ({ n, showNext = false }: IProps): React.ReactElement => { +export const BitNodeMultipliersDisplay = ({ n, level }: IProps): React.ReactElement => { const player = use.Player(); - const mults = getBitNodeMultipliers(n, player.sourceFileLvl(n) + +!!showNext); + const mults = getBitNodeMultipliers(n, level ?? Math.min(player.sourceFileLvl(n) + 1, n === 12 ? Infinity : 3)); return ( diff --git a/src/BitNode/ui/PortalModal.tsx b/src/BitNode/ui/PortalModal.tsx index c81a6790d..9b5cd560a 100644 --- a/src/BitNode/ui/PortalModal.tsx +++ b/src/BitNode/ui/PortalModal.tsx @@ -41,7 +41,7 @@ export function PortalModal(props: IProps): React.ReactElement {

{bitNode.info} - +