Skip to content

Commit

Permalink
bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
lifayi2008 committed Dec 8, 2022
1 parent 386854c commit 65a6927
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
4 changes: 3 additions & 1 deletion src/components/marketplace/AssetDetailInfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ AssetDetailInfo.propTypes = {
};

export default function AssetDetailInfo({ detail }) {
console.log(detail);
const infoItems = DETAILINFO_TITLE.map((title, index) => ({
title,
icon: DETAILINFO_ICONS[index],
Expand All @@ -83,7 +84,8 @@ export default function AssetDetailInfo({ detail }) {
royalties: `${(detail.royaltyFee * 100) / 10 ** 6} %`,
createTime: `${creatimestamp.date} ${creatimestamp.time}`,
marketTime: detail.listed ? `${marketimestamp.date} ${marketimestamp.time}` : 'Not on Sale',
saleType: detail?.isFirstSale ? 'Primary Sale' : 'Secondary Sale'
// eslint-disable-next-line no-nested-ternary
saleType: detail.listed ? (detail?.isFirstSale ? 'Primary Sale' : 'Secondary Sale') : 'Not on Sale'
};

return (
Expand Down
24 changes: 12 additions & 12 deletions src/pages/marketplace/CollectibleDetail.js
Original file line number Diff line number Diff line change
Expand Up @@ -277,18 +277,18 @@ export default function CollectibleDetail() {
);
const json = await res.json();
let collectibleDetail = json?.data || {};
// if (collectibleDetail?.uniqueKey) {
// const resSaleType = await fetchAPIFrom('api/v1/checkFirstSale', {
// method: 'POST',
// headers: {
// 'Content-Type': 'application/json'
// },
// body: JSON.stringify([collectibleDetail.uniqueKey])
// });
// const jsonSaleType = await resSaleType.json();
// if ((jsonSaleType?.data || []).length)
// collectibleDetail = { ...collectibleDetail, isFirstSale: json.data[0]?.isFirstSale || false };
// }
if (collectibleDetail?.uniqueKey) {
const resSaleType = await fetchAPIFrom('api/v1/checkFirstSale', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify([collectibleDetail.uniqueKey])
});
const jsonSaleType = await resSaleType.json();
if ((jsonSaleType?.data || []).length)
collectibleDetail = { ...collectibleDetail, isFirstSale: jsonSaleType.data[0]?.isFirstSale || false };
}
if (collectibleDetail?.order?.orderId) {
const resBid = await fetchAPIFrom(
`api/v1/getBidsHistory?chain=${chain}&orderId=${collectibleDetail.order.orderId}`,
Expand Down

1 comment on commit 65a6927

@vercel
Copy link

@vercel vercel bot commented on 65a6927 Dec 8, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.