Skip to content

Commit

Permalink
fix:#146-나의 거래/경매 페이지네이션 작동 오류 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
binjin0 committed Jul 24, 2024
1 parent 6e354cf commit 3a8be81
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 22 deletions.
48 changes: 37 additions & 11 deletions src/pages/MyAuctionList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,22 +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);
Expand Down
47 changes: 36 additions & 11 deletions src/pages/MyTradeList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,23 +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);
setMyBuyListOpen(false);
Expand Down

0 comments on commit 3a8be81

Please sign in to comment.