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 b8bc463 commit daf1fb6
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 3 deletions.
3 changes: 3 additions & 0 deletions src/components/dialog/CancelSale.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import Web3 from 'web3';
import { useSnackbar } from 'notistack';
import { Dialog, DialogTitle, DialogContent, IconButton, Typography, Box } from '@mui/material';
import CloseIcon from '@mui/icons-material/Close';
import {useNavigate} from "react-router-dom";
import { PASAR_CONTRACT_ABI } from '../../abi/pasarABI';
import { v1marketContract as V1_MARKET_CONTRACT_ADDRESS } from '../../config';
import TransLoadingButton from '../TransLoadingButton';
Expand All @@ -30,6 +31,7 @@ export default function CancelSale(props) {
const { enqueueSnackbar } = useSnackbar();
const { pasarLinkChain } = useSignin();
const v1State = order?.chain === 'v1';
const navigate = useNavigate();

const handleClose = () => {
setOpen(false);
Expand Down Expand Up @@ -91,6 +93,7 @@ export default function CancelSale(props) {
setOnProgress(true);
const _orderId = orderId !== undefined ? orderId : order.orderId;
await callCancelOrder(_orderId);
setTimeout(() => {navigate('/profile/myitem/0');}, 2000)
};
return (
<Dialog open={isOpen} onClose={handleClose}>
Expand Down
5 changes: 5 additions & 0 deletions src/components/dialog/DeleteItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import Web3 from 'web3';
import { Dialog, DialogTitle, DialogContent, IconButton, Typography, Link, Box } from '@mui/material';
import CloseIcon from '@mui/icons-material/Close';
import { useSnackbar } from 'notistack';
import {useNavigate} from "react-router-dom";
import { STICKER_CONTRACT_ABI } from '../../abi/stickerABI';
import { blankAddress } from '../../config';
import {
Expand Down Expand Up @@ -31,6 +32,7 @@ export default function DeleteItem(props) {
const [onProgress, setOnProgress] = React.useState(false);
const { enqueueSnackbar } = useSnackbar();
const { pasarLinkChain } = useSingin();
const navigate = useNavigate()

const handleClose = () => {
setOpen(false);
Expand Down Expand Up @@ -72,6 +74,9 @@ export default function DeleteItem(props) {
}, 3000);
enqueueSnackbar('Burn NFT success!', { variant: 'success' });
setOpen(false);
setTimeout(() => {
navigate('/profile/myitem/3');
}, 2000);
})
.on('confirmation', (confirmationNumber, receipt) => {
console.log('confirmation', confirmationNumber, receipt);
Expand Down
3 changes: 3 additions & 0 deletions src/components/dialog/PlaceBid.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import {
} from '@mui/material';
import CloseIcon from '@mui/icons-material/Close';
import { useSnackbar } from 'notistack';
import {useNavigate} from "react-router-dom";
import { PASAR_CONTRACT_ABI } from '../../abi/pasarABI';
import { ERC20_CONTRACT_ABI } from '../../abi/erc20ABI';
import { essentialsConnector } from '../signin-dlg/EssentialConnectivity';
Expand Down Expand Up @@ -65,6 +66,7 @@ export default function PlaceBid(props) {
const coinName = coinType.name;
const targetPrice = isBuynow ? math.round(info.order.buyoutPrice / 1e18, 3) : bidPrice;
const actionText = isBuynow ? 'Buy NFT' : 'Bid NFT';
const navigate = useNavigate()

const handleClose = () => {
setOpen(false);
Expand Down Expand Up @@ -140,6 +142,7 @@ export default function PlaceBid(props) {
setTimeout(() => {
setUpdateCount(updateCount + 1);
}, 1000);
setTimeout(() => {navigate('/profile/myitem/2');}, 2000)
})
.catch((error) => {
console.log(error);
Expand Down
2 changes: 1 addition & 1 deletion src/components/dialog/Purchase.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ export default function Purchase(props) {
setOnProgress(false);
setTimeout(() => {
navigate('/profile/myitem/1');
}, 3000);
}, 2000);
})
.catch((error) => {
console.log(error);
Expand Down
3 changes: 3 additions & 0 deletions src/components/dialog/Sell.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {
import CloseIcon from '@mui/icons-material/Close';
import { useSnackbar } from 'notistack';
import { Icon } from '@iconify/react';
import {useNavigate} from "react-router-dom";
import { STICKER_CONTRACT_ABI } from '../../abi/stickerABI';
import { essentialsConnector } from '../signin-dlg/EssentialConnectivity';
import TransLoadingButton from '../TransLoadingButton';
Expand Down Expand Up @@ -57,6 +58,7 @@ export default function Sell(props) {
const [onProgress, setOnProgress] = React.useState(false);
const [isOnValidation, setOnValidation] = React.useState(false);
const { diaBalance, pasarLinkChain } = useSingin();
const navigate = useNavigate();

const handleClose = () => {
setOpen(false);
Expand Down Expand Up @@ -166,6 +168,7 @@ export default function Sell(props) {
}, 3000);
enqueueSnackbar('Sell NFT success!', { variant: 'success' });
setOpen(false);
setTimeout(() => {navigate('/profile/myitem/0');window.location.reload()}, 2000)
} else {
enqueueSnackbar('Sell NFT error!', { variant: 'error' });
setOnProgress(false);
Expand Down
1 change: 1 addition & 0 deletions src/pages/collection/CreateCollection.js
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,7 @@ export default function CreateCollection() {
setBaseToken(paramObj._address);
console.log('receipt', receipt);
resolve(true);
setTimeout(() => {navigate('/profile/myitem/5');}, 2000)
})
.on('error', (error) => {
console.error('error', error);
Expand Down
1 change: 1 addition & 0 deletions src/pages/collection/ImportCollection.js
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,7 @@ export default function ImportCollection() {
setReadySignForRegister(false);
console.log('receipt', receipt);
resolve(true);
setTimeout(() => {navigate('/profile/myitem/5');}, 2000)
})
.on('error', (error) => {
console.error('error', error);
Expand Down
4 changes: 2 additions & 2 deletions src/pages/marketplace/CreateItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ import {
getChainTypeFromId,
getContractAddressInCurrentNetwork,
getTotalCountOfCoinTypes,

getStartPosOfCoinTypeByChainType, setAllTokenPrice2
} from '../../utils/common';
import { requestSigndataOnTokenID } from '../../utils/elastosConnectivityService';
Expand Down Expand Up @@ -1004,7 +1004,7 @@ export default function CreateItem() {
if (success) {
enqueueSnackbar('Mint token success!', { variant: 'success' });
setTimeout(() => {
navigate('/marketplace');
navigate('/profile/myitem/3');
}, 3000);
} else enqueueSnackbar('Mint token error!', { variant: 'warning' });
setOnProgress(false);
Expand Down

1 comment on commit daf1fb6

@vercel
Copy link

@vercel vercel bot commented on daf1fb6 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.