Skip to content

Commit

Permalink
Fixes bug that says you need more money for transfer when you have no…
Browse files Browse the repository at this point in the history
… more transfers
  • Loading branch information
Lukasdotcom committed Aug 12, 2022
1 parent 7125975 commit 47758d4
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions components/Player.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { useSession } from "next-auth/react";
import Username from "../components/Username";
import fallbackImg from "../public/playerFallback.png";
import Link from "next/link";
import { Button, Box, useTheme } from "@mui/material";
import { Button, CircularProgress } from "@mui/material";
// Used to create the layout for a player card that shows some simple details on a player just requires the data of the player to be passed into it and you can pass a custom button as a child of the component
function InternalPlayer({ data, children, starred }) {
const [pictureUrl, setPictureUrl] = useState(undefined);
Expand Down Expand Up @@ -95,7 +95,7 @@ function InternalPlayer({ data, children, starred }) {
} else {
return (
<div className={playerStyles.container}>
<p>loading...</p>
<CircularProgress />
</div>
);
}
Expand Down Expand Up @@ -243,6 +243,13 @@ export function TransferPlayer({
Transfer Market is Closed
</Button>
);
} else if (!transferLeft) {
PurchaseButton = (
<Button variant="outlined" disabled={true}>
No transfer left can&apos;t buy
</Button>
);
// Checks if the user owns the player and can sell the player
} else if (data.value > money) {
PurchaseButton = (
<Button variant="outlined" disabled={true}>
Expand Down

0 comments on commit 47758d4

Please sign in to comment.