[251124] fix: Log정리-4

🕐 커밋 시간: 2025. 11. 24. 12:19:40

📊 변경 통계:
  • 총 파일: 6개
  • 추가: +283줄
  • 삭제: -255줄

📝 수정된 파일:
  ~ com.twin.app.shoptime/src/actions/mainActions.js
  ~ com.twin.app.shoptime/src/reducers/mainReducer.js
  ~ com.twin.app.shoptime/src/reducers/searchReducer.js
  ~ com.twin.app.shoptime/src/views/PlayerPanel/PlayerTabContents/v2/TabContainer.v2.jsx
  ~ com.twin.app.shoptime/src/views/SearchPanel/SearchPanel.new.v2.jsx
  ~ com.twin.app.shoptime/src/views/SearchPanel/VoiceInputOverlay/VoiceInputOverlay.jsx

🔧 함수 변경 내용:
  📄 com.twin.app.shoptime/src/actions/mainActions.js (javascript):
    🔄 Modified: clearSubCategory()
  📄 com.twin.app.shoptime/src/views/PlayerPanel/PlayerTabContents/v2/TabContainer.v2.jsx (javascript):
    🔄 Modified: Spottable()
  📄 com.twin.app.shoptime/src/views/SearchPanel/VoiceInputOverlay/VoiceInputOverlay.jsx (javascript):
     Added: Spottable()
    🔄 Modified: clearAllTimers()

🔧 주요 변경 내용:
  • 핵심 비즈니스 로직 개선
This commit is contained in:
2025-11-24 12:19:40 +09:00
parent 5c3324c120
commit b95628de24
6 changed files with 343 additions and 358 deletions

View File

@@ -1,4 +1,9 @@
import { types } from '../actions/actionTypes';
import { createDebugHelpers } from '../utils/debug';
// 디버그 헬퍼 설정
const DEBUG_MODE = false;
const { dlog, dwarn, derror } = createDebugHelpers(DEBUG_MODE);
const initialState = {
searchDatas: {},
@@ -81,8 +86,8 @@ export const searchReducer = (state = initialState, action) => {
};
case types.RESET_VOICE_SEARCH:
console.log('[VoiceInput]-searchReducer-RESET_VOICE_SEARCH');
console.log(
dlog('[VoiceInput]-searchReducer-RESET_VOICE_SEARCH');
dlog(
JSON.stringify(
{
action: 'RESET_VOICE_SEARCH',
@@ -120,7 +125,7 @@ export const searchReducer = (state = initialState, action) => {
const newPreKey = action.payload?.results?.[0]?.searchId || 'null';
const oldPreKey = state.preShopperHouseData?.results?.[0]?.searchId || 'null';
console.log('[ShopperHouse]-DIFF (after backup) preShopperHouseKey:', oldPreKey, '→', newPreKey);
dlog('[ShopperHouse]-DIFF (after backup) preShopperHouseKey:', oldPreKey, '→', newPreKey);
return {
...state,
@@ -150,7 +155,16 @@ export const searchReducer = (state = initialState, action) => {
const preSortingType = state.preShopperHouseData?.results?.[0]?.sortingType || 'null';
// [VoiceInput] Redux에 저장 로그
console.log('[ShopperHouse]-DIFF (after API) shopperHouseKey:', newKey, '| preShopperHouseKey:', preKey, '| sortingType:', sortingType || 'null', '| preSortingType:', preSortingType);
dlog(
'[ShopperHouse]-DIFF (after API) shopperHouseKey:',
newKey,
'| preShopperHouseKey:',
preKey,
'| sortingType:',
sortingType || 'null',
'| preSortingType:',
preSortingType
);
return {
...state,
@@ -167,7 +181,7 @@ export const searchReducer = (state = initialState, action) => {
}
case types.SET_SHOPPERHOUSE_ERROR:
console.log('[VoiceInput] ❌ Redux shopperHouseError 저장:', action.payload);
dlog('[VoiceInput] ❌ Redux shopperHouseError 저장:', action.payload);
return {
...state,
shopperHouseError: action.payload,
@@ -177,7 +191,7 @@ export const searchReducer = (state = initialState, action) => {
};
case types.SHOW_SHOPPERHOUSE_ERROR:
console.log('[ShopperHouse] 🔴 Redux shopperHouseErrorPopup 표시:', action.payload);
dlog('[ShopperHouse] 🔴 Redux shopperHouseErrorPopup 표시:', action.payload);
return {
...state,
shopperHouseErrorPopup: {
@@ -190,7 +204,7 @@ export const searchReducer = (state = initialState, action) => {
};
case types.HIDE_SHOPPERHOUSE_ERROR:
console.log('[ShopperHouse] ✅ Redux shopperHouseErrorPopup 숨김');
dlog('[ShopperHouse] ✅ Redux shopperHouseErrorPopup 숨김');
return {
...state,
shopperHouseErrorPopup: {
@@ -203,16 +217,13 @@ export const searchReducer = (state = initialState, action) => {
};
case types.CLEAR_SHOPPERHOUSE_DATA:
console.log('[DEBUG] 🧹 Redux shopperHouseData 초기화 호출 - 호출 스택 추적:');
console.log(
'[DEBUG] 호출 위치:',
new Error().stack?.split('\n')[1]?.trim() || '(스택 추적 불가)'
);
console.log(
dlog('[DEBUG] 🧹 Redux shopperHouseData 초기화 호출 - 호출 스택 추적:');
dlog('[DEBUG] 호출 위치:', new Error().stack?.split('\n')[1]?.trim() || '(스택 추적 불가)');
dlog(
'[VoiceInput] 🧹 Redux shopperHouseData 초기화 (searchId & relativeQueries & preShopperHouseData는 유지)'
);
console.log('[VoiceInput]-searchReducer-CLEAR_SHOPPERHOUSE_DATA');
console.log(
dlog('[VoiceInput]-searchReducer-CLEAR_SHOPPERHOUSE_DATA');
dlog(
JSON.stringify(
{
shopperHouseData_cleared: true,
@@ -239,7 +250,7 @@ export const searchReducer = (state = initialState, action) => {
// 🔽 검색 메인 데이터 처리
case types.GET_SEARCH_MAIN: {
console.log('🔍 [searchReducer] GET_SEARCH_MAIN 받은 payload:', action.payload);
dlog('🔍 [searchReducer] GET_SEARCH_MAIN 받은 payload:', action.payload);
// 여러 가능한 구조 확인
let resultData = null;
@@ -247,15 +258,15 @@ export const searchReducer = (state = initialState, action) => {
if (action.payload?.result) {
// payload.result 구조
resultData = action.payload.result;
console.log('✅ [searchReducer] payload.result 구조 확인');
dlog('✅ [searchReducer] payload.result 구조 확인');
} else if (action.payload?.data?.result) {
// payload.data.result 구조
resultData = action.payload.data.result;
console.log('✅ [searchReducer] payload.data.result 구조 확인');
dlog('✅ [searchReducer] payload.data.result 구조 확인');
} else if (action.payload?.data) {
// payload.data에 직접 데이터가 있는 경우
resultData = action.payload.data;
console.log('✅ [searchReducer] payload.data 직접 구조 확인');
dlog('✅ [searchReducer] payload.data 직접 구조 확인');
}
if (!resultData) {
@@ -264,7 +275,7 @@ export const searchReducer = (state = initialState, action) => {
return state;
}
console.log('[searchReducer] ✅ GET_SEARCH_MAIN success');
dlog('[searchReducer] ✅ GET_SEARCH_MAIN success');
return {
...state,
@@ -278,7 +289,7 @@ export const searchReducer = (state = initialState, action) => {
}
case types.CLEAR_SEARCH_MAIN_DATA:
console.log('[searchReducer] 🧹 searchMainData 초기화');
dlog('[searchReducer] 🧹 searchMainData 초기화');
return {
...state,
searchMainData: {
@@ -291,7 +302,7 @@ export const searchReducer = (state = initialState, action) => {
// 🎯 [Phase 1] SearchPanel 모드 제어 명령
case types.SWITCH_TO_SEARCH_INPUT_OVERLAY:
console.log('[searchReducer] 🔄 SWITCH_TO_SEARCH_INPUT_OVERLAY 명령 저장', {
dlog('[searchReducer] 🔄 SWITCH_TO_SEARCH_INPUT_OVERLAY 명령 저장', {
source: action.payload?.source,
timestamp: new Date().toISOString(),
});