mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-16 06:18:42 +02:00
BIGFIX: IPvGO tutorial was getting stuck if you left the tab and returned (#2071)
This commit is contained in:
committed by
GitHub
parent
73dc9f2ef9
commit
376b561fed
@@ -1,4 +1,4 @@
|
||||
import React, { useRef, useState } from "react";
|
||||
import React, { useRef, useState, useEffect, useCallback } from "react";
|
||||
import { Typography, Button } from "@mui/material";
|
||||
|
||||
import { GoColor, GoValidity, ToastVariant } from "@enums";
|
||||
@@ -65,12 +65,17 @@ export function GoTutorialChallenge({
|
||||
}
|
||||
};
|
||||
|
||||
const reset = () => {
|
||||
const reset = useCallback(() => {
|
||||
stateRef.current = getStateCopy(state);
|
||||
stateRef.current.previousBoards = [];
|
||||
setDisplayText(description);
|
||||
setShowReset(false);
|
||||
};
|
||||
}, [state, description]);
|
||||
|
||||
// Ensure that the challenge is reset on unmount / mount
|
||||
useEffect(() => {
|
||||
reset();
|
||||
}, [reset]);
|
||||
|
||||
return (
|
||||
<div>
|
||||
|
||||
Reference in New Issue
Block a user