fix auction view exception

This commit is contained in:
Maxim Gordienko 2021-09-09 18:23:59 +03:00
parent c226677fc6
commit 9d8ba6d236
2 changed files with 19 additions and 11 deletions

View File

@ -512,15 +512,23 @@ export const AuctionCard = ({
bids.length === 0 &&
auctionView.auctionDataExtended?.info.instantSalePrice
) {
const bid = await sendPlaceBid(
connection,
wallet,
myPayingAccount.pubkey,
auctionView,
accountByMint,
auctionView.auctionDataExtended?.info.instantSalePrice,
);
setLastBid(bid);
try {
const bid = await sendPlaceBid(
connection,
wallet,
myPayingAccount.pubkey,
auctionView,
accountByMint,
auctionView.auctionDataExtended?.info.instantSalePrice,
);
setLastBid(bid);
} catch (e) {
console.error('sendPlaceBid', e)
setShowBidModal(false);
setLoading(false);
return;
}
}
await update();

View File

@ -24,7 +24,7 @@ export interface AuctionCard extends CardProps {
}
export const AuctionRenderCard = (props: AuctionCard) => {
let { auctionView } = props;
const { auctionView } = props;
const id = auctionView.thumbnail.metadata.pubkey;
const art = useArt(id);
const name = art?.title || ' ';
@ -42,7 +42,7 @@ export const AuctionRenderCard = (props: AuctionCard) => {
const isUpcoming = auctionView.state === AuctionViewState.Upcoming;
const winningBid = useHighestBidForAuction(auctionView.auction.pubkey);
const ended =
const ended = !auctionView.isInstantSale &&
state?.hours === 0 && state?.minutes === 0 && state?.seconds === 0;
let currentBid: number | string = 0;