Skip to content

Commit

Permalink
fix:fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
TiyoSheng committed Oct 30, 2023
1 parent 72330c8 commit c9deee3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/client/src/pages/home/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,10 @@ const Home = () => {
const play = () => {
let curPlayer = localStorage.getItem('curPlayer') || null;
let worldContractAddress = localStorage.getItem('worldContractAddress') || null;
if (curPlayer && curPlayer.addr == network.account && worldContractAddress == network.worldContract.address) {
curPlayer = JSON.parse(curPlayer);
if (curPlayer) curPlayer = JSON.parse(curPlayer);
console.log(curPlayer, worldContractAddress, network.account, network.worldContract.address)
console.log(curPlayer && curPlayer.addr.toLocaleLowerCase() == network.account.toLocaleLowerCase() && worldContractAddress?.toLocaleLowerCase() == network.worldContract.address.toLocaleLowerCase())
if (curPlayer?.addr?.toLocaleLowerCase() == network.account.toLocaleLowerCase() && worldContractAddress?.toLocaleLowerCase() == network.worldContract.address.toLocaleLowerCase()) {
// to /game
navigate('/game', {
state: {
Expand Down

0 comments on commit c9deee3

Please sign in to comment.