mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-28 20:07:04 +02:00
Merge pull request #2664 from MartinFournier/feature/recovery
Add information to the recovery page
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import React from "react";
|
||||
import React, { useEffect, useState } from "react";
|
||||
|
||||
import Accordion from "@mui/material/Accordion";
|
||||
import AccordionSummary from "@mui/material/AccordionSummary";
|
||||
@@ -17,6 +17,8 @@ interface IProps {
|
||||
}
|
||||
|
||||
export function General(props: IProps): React.ReactElement {
|
||||
const [error, setError] = useState(false);
|
||||
|
||||
function addMoney(n: number) {
|
||||
return function () {
|
||||
props.player.gainMoney(n, "other");
|
||||
@@ -43,6 +45,10 @@ export function General(props: IProps): React.ReactElement {
|
||||
props.router.toBitVerse(false, false);
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
if (error) throw new ReferenceError('Manually thrown error');
|
||||
}, [error]);
|
||||
|
||||
return (
|
||||
<Accordion TransitionProps={{ unmountOnExit: true }}>
|
||||
<AccordionSummary expandIcon={<ExpandMoreIcon />}>
|
||||
@@ -81,6 +87,7 @@ export function General(props: IProps): React.ReactElement {
|
||||
<Button onClick={b1tflum3}>Run b1t_flum3.exe</Button>
|
||||
<Button onClick={quickHackW0r1dD43m0n}>Quick w0rld_d34m0n</Button>
|
||||
<Button onClick={hackW0r1dD43m0n}>Hack w0rld_d34m0n</Button>
|
||||
<Button onClick={() => setError(true)}>Throw Error</Button>
|
||||
</AccordionDetails>
|
||||
</Accordion>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user