fix the errors about node setTimeout instead of window

This commit is contained in:
Olivier Gagnon 2021-08-27 01:11:11 -04:00
parent f08aa8924c
commit 3ab306f9d7
5 changed files with 6 additions and 6 deletions

@ -147,7 +147,7 @@ export class Roulette extends Game<IProps, IState> {
componentDidMount(): void { componentDidMount(): void {
this.interval = setInterval(this.step, 50); this.interval = window.setInterval(this.step, 50);
} }
step(): void { step(): void {

@ -87,7 +87,7 @@ export class SlotMachine extends Game<IProps, IState> {
} }
componentDidMount(): void { componentDidMount(): void {
this.interval = setInterval(this.step, 50); this.interval = window.setInterval(this.step, 50);
} }
step(): void { step(): void {

@ -39,9 +39,9 @@ export function SlashGame(props: IMinigameProps): React.ReactElement {
useEffect(() => { useEffect(() => {
let id2 = -1; let id2 = -1;
const id = setTimeout(() => { const id = window.setTimeout(() => {
setGuarding(false); setGuarding(false);
id2 = setTimeout(()=>setGuarding(true), difficulty.window) id2 = window.setTimeout(()=>setGuarding(true), difficulty.window)
}, Math.random()*3250+1500); }, Math.random()*3250+1500);
return () => { return () => {
clearInterval(id); clearInterval(id);

@ -31,7 +31,7 @@ export class AutoupdatingParagraph extends React.Component<IProps, IState> {
componentDidMount(): void { componentDidMount(): void {
const time = this.props.intervalTime ? this.props.intervalTime : 1000; const time = this.props.intervalTime ? this.props.intervalTime : 1000;
this.interval = setInterval(() => this.tick(), time); this.interval = window.setInterval(() => this.tick(), time);
} }
componentWillUnmount(): void { componentWillUnmount(): void {

@ -38,7 +38,7 @@ export class AutoupdatingStdButton extends React.Component<IProps, IState> {
componentDidMount(): void { componentDidMount(): void {
const time = this.props.intervalTime ? this.props.intervalTime : 1000; const time = this.props.intervalTime ? this.props.intervalTime : 1000;
this.interval = setInterval(() => this.tick(), time); this.interval = window.setInterval(() => this.tick(), time);
} }
componentWillUnmount(): void { componentWillUnmount(): void {