Skip to content

Commit

Permalink
Adds debug
Browse files Browse the repository at this point in the history
  • Loading branch information
Yauheni committed May 27, 2024
1 parent 685cafb commit 9326b39
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,15 @@ export const BattleRoundPlayers = () => {
const cnWrapper = 'relative flex flex-col';
const cnT = 'm-auto h-full w-full max-w-full';

console.log('----------PLAYERS----------');
console.log('battle');
console.log(battle);
console.log('currentPairIdx');
console.log(currentPairIdx);
console.log('battle?.pairs[currentPairIdx]');
console.log(battle?.pairs[currentPairIdx]);
console.log('---------------------------');

return (
<>
{battle && (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@ import { cn } from 'app/utils';

export const BattleRoundStats = () => {
const { rivals, currentPlayer, battle, currentPairIdx } = useBattle();

console.log('----------STATS----------');
console.log('battle');
console.log(battle);
console.log('currentPairIdx', currentPairIdx);
console.log('battle?.pairs[currentPairIdx]', battle?.pairs[currentPairIdx]);
console.log('state ---', battle?.state);
console.log('---------------------------');

return (
<div className="flex gap-10 justify-between items-center">
{battle && (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ export const BattleWinner = ({ battle }: { battle: BattleStateResponse }) => {
</div>
</section>
)}
{!winner && 'No winner'}
</>
);
};
Expand Down
4 changes: 3 additions & 1 deletion frontend/apps/tamagotchi-battle/src/pages/battle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ export const Battle = () => {
);

const gameIsOver = battle?.state === 'GameIsOver' && battle?.currentWinner;

console.log('BBBB');
console.log(battle);
console.log(!!gameIsOver);
return (
<>
{battle?.state === 'Registration' && (isAdmin ? <BattleWaitAdmin /> : <BattleWaitRegistration />)}
Expand Down

0 comments on commit 9326b39

Please sign in to comment.