mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-18 23:38:35 +02:00
fix a few bugs
This commit is contained in:
@@ -5,6 +5,8 @@ import { getAvailableCreatePrograms } from "../ProgramHelpers";
|
||||
import { Tooltip, Typography } from "@mui/material";
|
||||
import Button from "@mui/material/Button";
|
||||
|
||||
export const ProgramsSeen: string[] = [];
|
||||
|
||||
export function ProgramsRoot(): React.ReactElement {
|
||||
const player = use.Player();
|
||||
const router = use.Router();
|
||||
@@ -13,6 +15,15 @@ export function ProgramsRoot(): React.ReactElement {
|
||||
setRerender((old) => !old);
|
||||
}
|
||||
|
||||
const programs = getAvailableCreatePrograms(player);
|
||||
|
||||
useEffect(() => {
|
||||
programs.forEach((p) => {
|
||||
if (ProgramsSeen.includes(p.name)) return;
|
||||
ProgramsSeen.push(p.name);
|
||||
});
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
const id = setInterval(rerender, 200);
|
||||
return () => clearInterval(id);
|
||||
@@ -27,7 +38,7 @@ export function ProgramsRoot(): React.ReactElement {
|
||||
time. Your progress will be saved and you can continue later.
|
||||
</Typography>
|
||||
|
||||
{getAvailableCreatePrograms(player).map((program) => {
|
||||
{programs.map((program) => {
|
||||
const create = program.create;
|
||||
if (create === null) return <></>;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user