From d5c3d8961346d40a29476cf420fb04433d80fb78 Mon Sep 17 00:00:00 2001 From: Olivier Gagnon Date: Sat, 15 Jan 2022 18:13:35 -0500 Subject: [PATCH] fix bug --- src/DevMenu/ui/SourceFiles.tsx | 3 +++ src/ui/GameRoot.tsx | 23 ++++++++++++++++------- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/src/DevMenu/ui/SourceFiles.tsx b/src/DevMenu/ui/SourceFiles.tsx index 3b50cec04..cab4440a6 100644 --- a/src/DevMenu/ui/SourceFiles.tsx +++ b/src/DevMenu/ui/SourceFiles.tsx @@ -21,6 +21,9 @@ interface IProps { export function SourceFiles(props: IProps): React.ReactElement { function setSF(sfN: number, sfLvl: number) { return function () { + if (sfN === 9) { + props.player.hacknetNodes = []; + } if (sfLvl === 0) { props.player.sourceFiles = props.player.sourceFiles.filter((sf) => sf.n !== sfN); return; diff --git a/src/ui/GameRoot.tsx b/src/ui/GameRoot.tsx index 5fb4228bb..0a66a0bae 100644 --- a/src/ui/GameRoot.tsx +++ b/src/ui/GameRoot.tsx @@ -97,7 +97,7 @@ const useStyles = makeStyles((theme: Theme) => display: "block", padding: "8px", minHeight: "100vh", - boxSizing: 'border-box', + boxSizing: "border-box", }, }), ); @@ -222,7 +222,7 @@ export function GameRoot({ player, engine, terminal }: IProps): React.ReactEleme const [errorBoundaryKey, setErrorBoundaryKey] = useState(0); function resetErrorBoundary(): void { - setErrorBoundaryKey(errorBoundaryKey+1); + setErrorBoundaryKey(errorBoundaryKey + 1); } function rerender(): void { @@ -505,12 +505,21 @@ export function GameRoot({ player, engine, terminal }: IProps): React.ReactEleme return ( - + - - - {!ITutorial.isRunning ? ( - saveObject.saveGame()} killScripts={killAllScripts} /> + + + {!ITutorial.isRunning ? ( + saveObject.saveGame()} killScripts={killAllScripts} /> + ) : ( + + )} + + {withSidebar ? ( + + + {mainPage} + ) : ( {mainPage} )}