diff --git a/pages/index.js b/pages/index.js index 8ab1869..9b29206 100644 --- a/pages/index.js +++ b/pages/index.js @@ -25,6 +25,7 @@ export default class Home extends Component { constructor(props) { super(props); + this._mounted = false; this.state = { loading: true, steamId: undefined, @@ -44,6 +45,11 @@ export default class Home extends Component { } async componentDidMount() { + if (this._mounted === true) { + return; + } + this._mounted = true; + const urlSearchParams = new URLSearchParams(window.location.search); const params = Object.fromEntries(urlSearchParams.entries()); diff --git a/pages/overlay.js b/pages/overlay.js index 9796457..866b7c3 100644 --- a/pages/overlay.js +++ b/pages/overlay.js @@ -12,8 +12,8 @@ export default class Overlay extends Component { constructor(props) { super(props); - this._mounted = false; + this._mounted = false; this.state = { hasError: false, @@ -44,8 +44,8 @@ export default class Overlay extends Component { }, rightHand: { averageCut: [15.0], - averagePreSwing: [70.0], - averagePostSwing: [30.0], + averagePreSwing: [70.0],dd + averagePostSwing: [30.0],d }, }; this.setupTimer(); @@ -128,7 +128,6 @@ export default class Overlay extends Component { // Handle Errors static getDerivedStateFromError(error) { - console.log(error); return this.setState({ hasError: true }); } componentDidCatch(error, errorInfo) { @@ -210,8 +209,6 @@ export default class Overlay extends Component { async validateSteamId(id) { const data = await fetch(`/api/validateid?steamid=${id}`); const json = await data.json(); - console.log(json); - return json.message === "Valid" ? true : false; }