From 94efc150fad50233cb92093066c1a1ed85e23c3c Mon Sep 17 00:00:00 2001 From: xaler Date: Thu, 14 Nov 2024 20:45:15 +0100 Subject: [PATCH 1/2] :adhesive_bandage: Missing gamedata when web3 is present but not connected --- client/src/containers/Level.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/containers/Level.js b/client/src/containers/Level.js index 9bdbca987..fbe07ef81 100644 --- a/client/src/containers/Level.js +++ b/client/src/containers/Level.js @@ -29,6 +29,7 @@ class Level extends React.Component { } componentDidMount() { + this.props.loadGameData(); this.props.activateLevel(this.props.params.address); document.addEventListener("mousedown", this.handleClickOutside); } @@ -107,7 +108,6 @@ class Level extends React.Component { render() { const { level, levelCompleted } = this.props; const { submittedIntance } = this.state; - var [levelData, selectedLevel] = getlevelsdata(this.props, "levelPage"); if (!level) return null; From 8d482acb5550af25470c7da7791122793431a236 Mon Sep 17 00:00:00 2001 From: xaler Date: Thu, 14 Nov 2024 20:50:29 +0100 Subject: [PATCH 2/2] :zap: call loadGameData as soon as possible --- client/src/containers/Level.js | 1 - client/src/index.js | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/containers/Level.js b/client/src/containers/Level.js index fbe07ef81..fee6e72c9 100644 --- a/client/src/containers/Level.js +++ b/client/src/containers/Level.js @@ -29,7 +29,6 @@ class Level extends React.Component { } componentDidMount() { - this.props.loadGameData(); this.props.activateLevel(this.props.params.address); document.addEventListener("mousedown", this.handleClickOutside); } diff --git a/client/src/index.js b/client/src/index.js index 3d15c7957..a89708870 100644 --- a/client/src/index.js +++ b/client/src/index.js @@ -53,6 +53,7 @@ if (!window.ethereum) { } else { const accountConnectionWindow = document.querySelectorAll('.account-connection-window-bg'); if (accountConnectionWindow[0]) accountConnectionWindow[0].style.display = 'block'; + store.dispatch(actions.loadGamedata()); } }); }