[251105] feat: CheckOutPanel에서 DetailPanel으로 복귀 시 데이터 재로드
- CheckOutPanel Back/Cancel 버튼에서 DetailPanel에 shouldReload 신호 전달 - DetailPanel에 panelShouldReload 플래그 추가 - panelShouldReload useEffect로 데이터 초기화 및 재로딩 구현 - DetailPanel 스택 유지로 자연스러운 네비게이션 제공 Generated with coding tools Co-Authored-By: Dev Team <noreply@dev.team>
This commit is contained in:
@@ -409,13 +409,20 @@ export default function CheckOutPanel({ panelInfo }) {
|
||||
}, [activePopup]);
|
||||
|
||||
const onBackClick = useCallback(() => {
|
||||
console.log('[BuyOption][CheckOutPanel] onBackClick called - dispatching popPanel');
|
||||
console.log('[BuyOption][CheckOutPanel] Current panels before pop:', panels?.map((p) => p.name));
|
||||
console.log('[CheckOutPanel] onBackClick - Sending reload signal to DetailPanel');
|
||||
|
||||
// 확실한 popPanel 호출 - CheckOutPanel만 제거
|
||||
// DetailPanel에 재시작 신호 전달
|
||||
dispatch(updatePanel({
|
||||
name: Config.panel_names.DETAIL_PANEL,
|
||||
panelInfo: {
|
||||
shouldReload: true,
|
||||
}
|
||||
}));
|
||||
|
||||
// CheckOutPanel 제거
|
||||
dispatch(popPanel(Config.panel_names.CHECKOUT_PANEL));
|
||||
|
||||
console.log('[BuyOption][CheckOutPanel] popPanel dispatched for CHECKOUT_PANEL');
|
||||
console.log('[CheckOutPanel] popPanel dispatched for CHECKOUT_PANEL');
|
||||
}, [dispatch, panels]);
|
||||
|
||||
const toggleOrderSideBar = useCallback(() => {
|
||||
@@ -538,14 +545,21 @@ export default function CheckOutPanel({ panelInfo }) {
|
||||
}
|
||||
|
||||
if (!orderSideBarOpen && !offerSideBarOpen) {
|
||||
console.log('[BuyOption][CheckOutPanel] onCancelCheckoutPanel - calling popPanel for CHECKOUT_PANEL');
|
||||
console.log('[BuyOption][CheckOutPanel] Current panels before cancel pop:', panels?.map((p) => p.name));
|
||||
console.log('[CheckOutPanel] onCancelCheckoutPanel - Sending reload signal to DetailPanel');
|
||||
|
||||
// 확실한 popPanel 호출 - CheckOutPanel만 제거
|
||||
// DetailPanel에 재시작 신호 전달
|
||||
dispatch(updatePanel({
|
||||
name: Config.panel_names.DETAIL_PANEL,
|
||||
panelInfo: {
|
||||
shouldReload: true,
|
||||
}
|
||||
}));
|
||||
|
||||
// CheckOutPanel 제거
|
||||
dispatch(popPanel(Config.panel_names.CHECKOUT_PANEL));
|
||||
e.stopPropagation();
|
||||
|
||||
console.log('[BuyOption][CheckOutPanel] popPanel dispatched for CHECKOUT_PANEL from cancel');
|
||||
console.log('[CheckOutPanel] popPanel dispatched for CHECKOUT_PANEL from cancel');
|
||||
}
|
||||
},
|
||||
[orderSideBarOpen, offerSideBarOpen, dispatch, panels]
|
||||
|
||||
Reference in New Issue
Block a user