Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pulling refs/heads/staging into test-staging #2082

Merged
merged 4 commits into from
Dec 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion components/front-page/HeroBanner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export const HeroBanner = ({
Welcome to the Future of Betting
</h1>
<h2 className="mb-8 text-xl leading-6">
Zeitgeist is a new innovative platform for predicting future events
Zeitgeist is an innovative platform for predicting future events
</h2>
<div className="mb-14 flex gap-4">
<Link
Expand Down
12 changes: 9 additions & 3 deletions components/trade-form/BuyForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,13 @@ const BuyForm = ({
const subscription = watch((value, { name, type }) => {
const changedByUser = type != null;

if (!changedByUser || !maxSpendableBalance || !maxAmountIn) return;
if (
!changedByUser ||
!maxSpendableBalance ||
maxSpendableBalance.eq(0) ||
!maxAmountIn
)
return;

if (name === "percentage") {
const max = maxSpendableBalance.greaterThan(maxAmountIn)
Expand Down Expand Up @@ -255,9 +261,9 @@ const BuyForm = ({
},
validate: (value) => {
if (value > (maxSpendableBalance?.div(ZTG).toNumber() ?? 0)) {
return `Insufficient balance. Current balance: ${maxSpendableBalance
return `Insufficient balance (${maxSpendableBalance
?.div(ZTG)
.toFixed(3)}`;
.toFixed(3)}${baseSymbol})`;
} else if (value <= 0) {
return "Value cannot be zero or less";
} else if (maxAmountIn?.div(ZTG)?.lessThanOrEqualTo(value)) {
Expand Down
8 changes: 7 additions & 1 deletion components/trade-form/SellForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,13 @@ const SellForm = ({
const subscription = watch((value, { name, type }) => {
const changedByUser = type != null;

if (!changedByUser || !selectedAssetBalance || !maxAmountIn) return;
if (
!changedByUser ||
!selectedAssetBalance ||
selectedAssetBalance.eq(0) ||
!maxAmountIn
)
return;

if (name === "percentage") {
const max = selectedAssetBalance.greaterThan(maxAmountIn)
Expand Down