mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-12-19 04:35:46 +01:00
fixed issue with duplicate programs (#447)
This commit is contained in:
parent
9353129e84
commit
3c18fd7a51
@ -10,7 +10,7 @@ import { Player } from "@player";
|
||||
import { Settings } from "../../Settings/Settings";
|
||||
|
||||
import { Programs } from "../Programs";
|
||||
import { CreateProgramWork } from "../../Work/CreateProgramWork";
|
||||
import { CreateProgramWork, isCreateProgramWork } from "../../Work/CreateProgramWork";
|
||||
import { useRerender } from "../../ui/React/hooks";
|
||||
|
||||
export const ProgramsSeen: string[] = [];
|
||||
@ -91,6 +91,9 @@ export function ProgramsRoot(): React.ReactElement {
|
||||
sx={{ my: 1, width: "100%" }}
|
||||
onClick={(event) => {
|
||||
if (!event.isTrusted) return;
|
||||
if (isCreateProgramWork(Player.currentWork)) {
|
||||
Player.finishWork(true);
|
||||
}
|
||||
Player.startWork(new CreateProgramWork({ singularity: false, programName: program.name }));
|
||||
Player.startFocusing();
|
||||
Router.toPage(Page.Work);
|
||||
|
Loading…
Reference in New Issue
Block a user