Skip to content

Commit

Permalink
airdrop
Browse files Browse the repository at this point in the history
  • Loading branch information
TiyoSheng committed Nov 23, 2023
1 parent 122afef commit 9c31851
Show file tree
Hide file tree
Showing 8 changed files with 1,980 additions and 1,948 deletions.
6 changes: 4 additions & 2 deletions packages/client/src/pages/game/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,6 @@ const Game = () => {
try {
curPlayer.waiting = true;
await goHome();
await joinBattlefield()
curPlayer.waiting = false;
} catch (error) {
console.log(error)
Expand All @@ -347,12 +346,15 @@ const Game = () => {
}
}

const closeUserInfoDialog = () => {
const closeUserInfoDialog = async () => {
if (curPlayer.waiting) {
message.error('Waiting for transaction');
return;
} else {
message.loading('join battlefield')
await joinBattlefield()
setUserInfoVisible(false);
message.destroy()
}
}

Expand Down
10 changes: 7 additions & 3 deletions packages/client/src/pages/home/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ const Home = () => {

const GameConfigData = useEntityQuery([Has(GameConfig)]).map((entity) => getComponentValue(GameConfig, entity));

// const syncprogressData = useEntityQuery([Has(SyncProgress)]).map((entity) => getComponentValue(SyncProgress, entity));
// const syncprogress = syncprogressData[0]
const syncprogressData = useEntityQuery([Has(SyncProgress)]).map((entity) => getComponentValue(SyncProgress, entity));
const syncprogress = syncprogressData[0]
// console.log(GameConfigData, 'GlobalConfigData', syncprogress)

// useEffect(() => {
Expand Down Expand Up @@ -307,6 +307,10 @@ const Home = () => {
message.error(`Please wait for open demo day`);
return;
}
if (syncprogress?.percentage < 100) {
message.error(`Please wait for sync progress`);
return;
}
if (!network.account) {
message.error('waiting for wallet connection');
return;
Expand Down Expand Up @@ -341,7 +345,7 @@ const Home = () => {

Just when the plan was about to succeed, a group of crazy duck adventurers stormed into the cave...
</p>
<button className="play-btn mi-btn" onClick={play}>{(!isOpen) ? 'Please wait for open demo day' : 'PLAY NOW'}</button>
<button className="play-btn mi-btn" onClick={play}>{(!isOpen) ? 'Please wait for open demo day' : syncprogress?.percentage == 100 ? 'PLAY NOW' : 'WATING'}</button>

</div>
</div>
Expand Down
Loading

0 comments on commit 9c31851

Please sign in to comment.