mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-25 02:32:55 +02:00
Add ErrorBoundary component to catch rendering error and redirect to recovery page
also add softreset button on recovery page
This commit is contained in:
@@ -15,9 +15,10 @@ export function ActivateRecoveryMode(): void {
|
||||
|
||||
interface IProps {
|
||||
router: IRouter;
|
||||
softReset: () => void;
|
||||
}
|
||||
|
||||
export function RecoveryRoot({ router }: IProps): React.ReactElement {
|
||||
export function RecoveryRoot({ router, softReset }: IProps): React.ReactElement {
|
||||
function recover(): void {
|
||||
RecoveryMode = false;
|
||||
router.toTerminal();
|
||||
@@ -48,6 +49,7 @@ export function RecoveryRoot({ router }: IProps): React.ReactElement {
|
||||
<br />
|
||||
<Typography>You can disable recovery mode now. But chances are the game will not work correctly.</Typography>
|
||||
<Button onClick={recover}>DISABLE RECOVERY MODE</Button>
|
||||
<Button onClick={softReset}>PERFORM SOFT RESET</Button>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user