mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-26 09:33:49 +01:00
fix bug
This commit is contained in:
parent
8d3c366e0e
commit
d5c3d89613
@ -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;
|
||||
|
@ -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<number>(0);
|
||||
|
||||
function resetErrorBoundary(): void {
|
||||
setErrorBoundaryKey(errorBoundaryKey+1);
|
||||
setErrorBoundaryKey(errorBoundaryKey + 1);
|
||||
}
|
||||
|
||||
function rerender(): void {
|
||||
@ -507,10 +507,19 @@ export function GameRoot({ player, engine, terminal }: IProps): React.ReactEleme
|
||||
<Context.Player.Provider value={player}>
|
||||
<Context.Router.Provider value={Router}>
|
||||
<ErrorBoundary key={errorBoundaryKey} router={Router} softReset={softReset}>
|
||||
<SnackbarProvider>
|
||||
<Overview mode={ITutorial.isRunning ? "tutorial" : "overview"}>
|
||||
{!ITutorial.isRunning ? (
|
||||
<CharacterOverview save={() => saveObject.saveGame()} killScripts={killAllScripts} />
|
||||
<SnackbarProvider>
|
||||
<Overview mode={ITutorial.isRunning ? "tutorial" : "overview"}>
|
||||
{!ITutorial.isRunning ? (
|
||||
<CharacterOverview save={() => saveObject.saveGame()} killScripts={killAllScripts} />
|
||||
) : (
|
||||
<InteractiveTutorialRoot />
|
||||
)}
|
||||
</Overview>
|
||||
{withSidebar ? (
|
||||
<Box display="flex" flexDirection="row" width="100%">
|
||||
<SidebarRoot player={player} router={Router} page={page} />
|
||||
<Box className={classes.root}>{mainPage}</Box>
|
||||
</Box>
|
||||
) : (
|
||||
<Box className={classes.root}>{mainPage}</Box>
|
||||
)}
|
||||
|
Loading…
Reference in New Issue
Block a user