mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-10 01:33:54 +01:00
fix the errors about node setTimeout instead of window
This commit is contained in:
parent
f08aa8924c
commit
3ab306f9d7
@ -147,7 +147,7 @@ export class Roulette extends Game<IProps, IState> {
|
||||
|
||||
|
||||
componentDidMount(): void {
|
||||
this.interval = setInterval(this.step, 50);
|
||||
this.interval = window.setInterval(this.step, 50);
|
||||
}
|
||||
|
||||
step(): void {
|
||||
|
@ -87,7 +87,7 @@ export class SlotMachine extends Game<IProps, IState> {
|
||||
}
|
||||
|
||||
componentDidMount(): void {
|
||||
this.interval = setInterval(this.step, 50);
|
||||
this.interval = window.setInterval(this.step, 50);
|
||||
}
|
||||
|
||||
step(): void {
|
||||
|
@ -39,9 +39,9 @@ export function SlashGame(props: IMinigameProps): React.ReactElement {
|
||||
|
||||
useEffect(() => {
|
||||
let id2 = -1;
|
||||
const id = setTimeout(() => {
|
||||
const id = window.setTimeout(() => {
|
||||
setGuarding(false);
|
||||
id2 = setTimeout(()=>setGuarding(true), difficulty.window)
|
||||
id2 = window.setTimeout(()=>setGuarding(true), difficulty.window)
|
||||
}, Math.random()*3250+1500);
|
||||
return () => {
|
||||
clearInterval(id);
|
||||
|
@ -31,7 +31,7 @@ export class AutoupdatingParagraph extends React.Component<IProps, IState> {
|
||||
|
||||
componentDidMount(): void {
|
||||
const time = this.props.intervalTime ? this.props.intervalTime : 1000;
|
||||
this.interval = setInterval(() => this.tick(), time);
|
||||
this.interval = window.setInterval(() => this.tick(), time);
|
||||
}
|
||||
|
||||
componentWillUnmount(): void {
|
||||
|
@ -38,7 +38,7 @@ export class AutoupdatingStdButton extends React.Component<IProps, IState> {
|
||||
|
||||
componentDidMount(): void {
|
||||
const time = this.props.intervalTime ? this.props.intervalTime : 1000;
|
||||
this.interval = setInterval(() => this.tick(), time);
|
||||
this.interval = window.setInterval(() => this.tick(), time);
|
||||
}
|
||||
|
||||
componentWillUnmount(): void {
|
||||
|
Loading…
Reference in New Issue
Block a user