release/86 #2
No files matched your search
@@ -786,19 +786,31 @@ export default function AuctionPage() {
|
||||
const historyBackTo = `${location.pathname}${location.search}${location.hash}`;
|
||||
const canConfirmAuctionCancel = cancelConfirmText.trim() === '예';
|
||||
|
||||
async function invalidateAuctionData() {
|
||||
async function clearAuctionDataAfterCancel() {
|
||||
if (!id) return;
|
||||
const auctionQueryKey = ['auction', DEFAULT_COMMUNITY_ID, id] as const;
|
||||
const auctionHistoryQueryKey = [
|
||||
'auction-history',
|
||||
DEFAULT_COMMUNITY_ID,
|
||||
id,
|
||||
] as const;
|
||||
|
||||
await Promise.all([
|
||||
queryClient.invalidateQueries({
|
||||
queryKey: ['auction', DEFAULT_COMMUNITY_ID, id],
|
||||
}),
|
||||
queryClient.invalidateQueries({
|
||||
queryKey: ['auction-history', DEFAULT_COMMUNITY_ID, id],
|
||||
}),
|
||||
queryClient.invalidateQueries({
|
||||
queryKey: ['match', DEFAULT_COMMUNITY_ID, id],
|
||||
queryClient.cancelQueries({ queryKey: auctionQueryKey, exact: true }),
|
||||
queryClient.cancelQueries({
|
||||
queryKey: auctionHistoryQueryKey,
|
||||
exact: true,
|
||||
}),
|
||||
]);
|
||||
queryClient.removeQueries({ queryKey: auctionQueryKey, exact: true });
|
||||
queryClient.removeQueries({
|
||||
queryKey: auctionHistoryQueryKey,
|
||||
exact: true,
|
||||
});
|
||||
await queryClient.invalidateQueries({
|
||||
queryKey: ['match', DEFAULT_COMMUNITY_ID, id],
|
||||
exact: true,
|
||||
});
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
@@ -848,7 +860,7 @@ export default function AuctionPage() {
|
||||
|
||||
useEffect(() => {
|
||||
if (!socket.resetAt || !id) return;
|
||||
void invalidateAuctionData().finally(() => {
|
||||
void clearAuctionDataAfterCancel().finally(() => {
|
||||
navigate(`/match/${id}`, { replace: true });
|
||||
});
|
||||
}, [id, navigate, socket.resetAt]);
|
||||
@@ -959,7 +971,7 @@ export default function AuctionPage() {
|
||||
onSuccess: async () => {
|
||||
setShowCancelModal(false);
|
||||
setCancelConfirmText('');
|
||||
await invalidateAuctionData();
|
||||
await clearAuctionDataAfterCancel();
|
||||
navigate(`/match/${id}`, { replace: true });
|
||||
},
|
||||
},
|
||||
|
||||
@@ -2752,7 +2752,8 @@ export default function MatchDetailPage() {
|
||||
meQuery.isLoading || (meQuery.isFetching && !meQuery.data);
|
||||
const auctionNotStarted =
|
||||
auctionQuery.error instanceof ApiError && auctionQuery.error.status === 404;
|
||||
const showAuctionLink = Boolean(auctionQuery.data);
|
||||
const activeAuction = auctionNotStarted ? null : auctionQuery.data;
|
||||
const showAuctionLink = Boolean(activeAuction);
|
||||
const auctionParticipantPool = buildAuctionParticipantPool(
|
||||
matchQuery.data.participants,
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user