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

fix:#146-나의 거래/경매 페이지네이션 작동오류 수정 #147

Closed
wants to merge 1 commit into from
Closed
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
47 changes: 36 additions & 11 deletions src/pages/MyAuctionList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,23 +30,48 @@ const MyAuctionList = () => {
const navigate = useNavigate();
const { t } = useTranslation();

// useEffect(() => {
// const fetchAllData = async () => {
// await handleDoneAuction();
// await handleOnAuction();
// };
// fetchAllData();
// if (mySellListOpen) {
// if (onSale) {
// handleOnAuction();
// } else {
// handleDoneAuction();
// }
// } else if (myBuyListOpen) {
// handleMyBuyListOpen();
// }
// }, [pageBuy, pageOngoing, pageClose]);
useEffect(() => {
const fetchAllData = async () => {
await handleDoneAuction();
await handleOnAuction();
if (mySellListOpen) {
await handleDoneAuction();
} else if (myBuyListOpen) {
await handleMyBuyListOpen();
}
};

fetchAllData();
if (mySellListOpen) {
if (onSale) {
handleOnAuction();
} else {
handleDoneAuction();
}, []);
useEffect(() => {
const fetchAllData = async () => {
if (mySellListOpen) {
if (onSale) {
await handleOnAuction();
} else {
await handleDoneAuction();
}
} else if (myBuyListOpen) {
await handleMyBuyListOpen();
}
} else if (myBuyListOpen) {
handleMyBuyListOpen();
}
}, [pageBuy, pageOngoing, pageClose]);
};

fetchAllData();
}, [pageBuy, pageOngoing, pageClose, mySellListOpen, myBuyListOpen, onSale]);
const handleMySellListOpen = async () => {
setMySellListOpen(true);
setMyBuyListOpen(false);
Expand Down
48 changes: 37 additions & 11 deletions src/pages/MyTradeList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,22 +34,48 @@ const MyTradeList = () => {

const navigate = useNavigate();

// useEffect(() => {
// const fetchAllData = async () => {
// await handleDoneSale();
// await handleOnSale();
// };
// fetchAllData();
// if (mySellListOpen) {
// if (onSale) {
// handleOnSale();
// } else {
// handleDoneSale();
// }
// } else if (myBuyListOpen) {
// handleMyBuyListOpen();
// }
// }, [pageBuy, pageOngoing, pageClose]);
useEffect(() => {
const fetchAllData = async () => {
await handleDoneSale();
await handleOnSale();
if (mySellListOpen) {
await handleDoneSale();
} else if (myBuyListOpen) {
await handleMyBuyListOpen();
}
};

fetchAllData();
if (mySellListOpen) {
if (onSale) {
handleOnSale();
} else {
handleDoneSale();
}, []);
useEffect(() => {
const fetchAllData = async () => {
if (mySellListOpen) {
if (onSale) {
await handleOnSale();
} else {
await handleDoneSale();
}
} else if (myBuyListOpen) {
await handleMyBuyListOpen();
}
} else if (myBuyListOpen) {
handleMyBuyListOpen();
}
}, [pageBuy, pageOngoing, pageClose]);
};

fetchAllData();
}, [pageBuy, pageOngoing, pageClose, mySellListOpen, myBuyListOpen, onSale]);

const handleMySellListOpen = async () => {
setMySellListOpen(true);
Expand Down