Skip to content

Commit

Permalink
Syndote: Correets poolPrize value
Browse files Browse the repository at this point in the history
  • Loading branch information
Yauheni committed May 2, 2024
1 parent 73cfdc8 commit b815383
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion frontend/apps/syndote/src/pages/home/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ function Home() {
const { properties, ownership } = roll || {};
const playersArray = state?.players || [];

const getPlayers = () => state?.players || [];
const getPlayers = () => (isGameStarted && roll ? roll?.players : state?.players || []);

const findPlayer = (address: string) => getPlayers().find(([newAddress]) => newAddress === address)?.[1];

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useApi, useBalanceFormat, useAccount } from '@gear-js/react-hooks';
import { useApi, useBalanceFormat, useAccount, withoutCommas } from '@gear-js/react-hooks';
import { Modal } from 'components/layout/modal';
import { Button } from '@gear-js/vara-ui';
import { GameDetails } from 'components/layout/game-details';
Expand All @@ -15,9 +15,9 @@ type Props = {
onClose: () => void;
};

function GameFinishedModal({ winnerAddress, isAdmin, players, prizePool, onClose }: Props) {
function GameFinishedModal({ winnerAddress, isAdmin, players, prizePool = '0', onClose }: Props) {
const { account } = useAccount();
const { getFormattedGasValue } = useBalanceFormat();
const { getFormattedBalanceValue } = useBalanceFormat();
const { deleteGame, exitGame } = useQuitGame();

const isWinner = account?.decodedAddress === players[winnerAddress].ownerId;
Expand All @@ -28,7 +28,7 @@ function GameFinishedModal({ winnerAddress, isAdmin, players, prizePool, onClose
name: `Winner's prize:`,
value: (
<>
<VaraIcon /> {getFormattedGasValue(prizePool || 0).toFixed()} VARA
<VaraIcon /> {getFormattedBalanceValue(withoutCommas(prizePool) || 0).toFixed(2)} VARA
</>
),
key: '1',
Expand Down

0 comments on commit b815383

Please sign in to comment.