Skip to content

Commit

Permalink
feat: added context to GameField #190
Browse files Browse the repository at this point in the history
  • Loading branch information
habdevs committed Sep 13, 2023
1 parent bf5d50b commit f28eb8d
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions components/GameField/GameField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,19 @@ export const GameField: React.FC<GameFieldPropsI> = ({
const [isShowDispute, setShowDispute] = useState<boolean>(false);
const { t } = useTranslation();
const account = useAccount();

const { setFinishResult } = useGameStateContext();
const { data, error, loading } = useQuery(badgesQuery, {
variables: { id: account.address?.toLowerCase() },
});

// TODO added context @habdevs #190
if (finishGameCheckResult) {
setFinishResult({
winner: finishGameCheckResult.winner,
isDraw: finishGameCheckResult.isDraw,
cheatWin: finishGameCheckResult.cheatWin,
});
console.log('CONTEXT GAMEFIELD', setFinishResult)
}
console.log('dispute mode', disputeMode, account.address);

function isOpponentAddress(address: string): boolean {
Expand Down

0 comments on commit f28eb8d

Please sign in to comment.