[251124] fix: Log정리-2
🕐 커밋 시간: 2025. 11. 24. 12:03:52 📊 변경 통계: • 총 파일: 5개 • 추가: +306줄 • 삭제: -256줄 📝 수정된 파일: ~ com.twin.app.shoptime/src/actions/productActions.js ~ com.twin.app.shoptime/src/components/VideoPlayer/VideoPlayer.js ~ com.twin.app.shoptime/src/reducers/panelReducer.js ~ com.twin.app.shoptime/src/views/MyPagePanel/MyPageSub/TermsOfService/TermsOfOptional.jsx ~ com.twin.app.shoptime/src/views/PlayerPanel/PlayerPanel.jsx 🔧 함수 변경 내용: 📄 com.twin.app.shoptime/src/actions/productActions.js (javascript): ✅ Added: dwarn(), derror(), onSuccess() 🔄 Modified: pickParams(), createGetThunk(), async() ❌ Deleted: onSuccess() 📄 com.twin.app.shoptime/src/components/VideoPlayer/VideoPlayer.js (javascript): ✅ Added: dwarn(), derror() 📄 com.twin.app.shoptime/src/reducers/panelReducer.js (javascript): ✅ Added: dwarn(), derror() 📄 com.twin.app.shoptime/src/views/MyPagePanel/MyPageSub/TermsOfService/TermsOfOptional.jsx (javascript): ✅ Added: dwarn(), derror(), onSuccess(), onTestSuccess() ❌ Deleted: onSuccess(), onTestSuccess() 📄 com.twin.app.shoptime/src/views/PlayerPanel/PlayerPanel.jsx (javascript): ✅ Added: dwarn(), derror() 🔧 주요 변경 내용: • 핵심 비즈니스 로직 개선 • UI 컴포넌트 아키텍처 개선 • API 서비스 레이어 개선
This commit is contained in:
@@ -1,6 +1,21 @@
|
||||
import { types } from '../actions/actionTypes';
|
||||
import { panel_names } from '../utils/Config';
|
||||
|
||||
// Toggle debug logging for this reducer
|
||||
const DEBUG_MODE = false;
|
||||
|
||||
const dlog = (...args) => {
|
||||
if (DEBUG_MODE) console.log(...args);
|
||||
};
|
||||
|
||||
const dwarn = (...args) => {
|
||||
if (DEBUG_MODE) console.warn(...args);
|
||||
};
|
||||
|
||||
const derror = (...args) => {
|
||||
console.error(...args);
|
||||
};
|
||||
|
||||
const initialState = {
|
||||
// 기존 상태 - 완전히 호환됨
|
||||
panels: [],
|
||||
@@ -29,7 +44,7 @@ const forceTopPanels = [panel_names.ERROR_PANEL, panel_names.INTRO_PANEL, panel_
|
||||
export const panelsReducer = (state = initialState, action) => {
|
||||
switch (action.type) {
|
||||
case types.PUSH_PANEL: {
|
||||
console.log('[panelReducer] 🔵 PUSH_PANEL START', {
|
||||
dlog('[panelReducer] 🔵 PUSH_PANEL START', {
|
||||
newPanelName: action.payload.name,
|
||||
currentPanels: state.panels.map((p) => p.name),
|
||||
duplicatable: action.duplicatable,
|
||||
@@ -76,7 +91,7 @@ export const panelsReducer = (state = initialState, action) => {
|
||||
}
|
||||
}
|
||||
|
||||
console.log('[panelReducer] 🔵 PUSH_PANEL END', {
|
||||
dlog('[panelReducer] 🔵 PUSH_PANEL END', {
|
||||
resultPanels: newState.map((p) => p.name),
|
||||
lastAction,
|
||||
});
|
||||
@@ -89,7 +104,7 @@ export const panelsReducer = (state = initialState, action) => {
|
||||
}
|
||||
|
||||
case types.POP_PANEL: {
|
||||
console.log('[panelReducer] 🔴 POP_PANEL START', {
|
||||
dlog('[panelReducer] 🔴 POP_PANEL START', {
|
||||
targetPanel: action.payload || 'last_panel',
|
||||
currentPanels: state.panels.map((p) => p.name),
|
||||
});
|
||||
@@ -113,7 +128,7 @@ export const panelsReducer = (state = initialState, action) => {
|
||||
resultPanels = state.panels.slice(0, state.panels.length - 1);
|
||||
}
|
||||
|
||||
console.log('[panelReducer] 🔴 POP_PANEL END', {
|
||||
dlog('[panelReducer] 🔴 POP_PANEL END', {
|
||||
resultPanels: resultPanels.map((p) => p.name),
|
||||
lastAction,
|
||||
});
|
||||
@@ -159,7 +174,7 @@ export const panelsReducer = (state = initialState, action) => {
|
||||
};
|
||||
}
|
||||
case types.RESET_PANELS: {
|
||||
console.log('[panelReducer] 🟢 RESET_PANELS START', {
|
||||
dlog('[panelReducer] 🟢 RESET_PANELS START', {
|
||||
currentPanels: state.panels.map((p) => p.name),
|
||||
payloadProvided: !!action.payload,
|
||||
});
|
||||
@@ -171,7 +186,7 @@ export const panelsReducer = (state = initialState, action) => {
|
||||
}))
|
||||
: [];
|
||||
|
||||
console.log('[panelReducer] 🟢 RESET_PANELS END', {
|
||||
dlog('[panelReducer] 🟢 RESET_PANELS END', {
|
||||
resultPanels: updatedPanels.map((p) => p.name),
|
||||
});
|
||||
|
||||
@@ -184,7 +199,7 @@ export const panelsReducer = (state = initialState, action) => {
|
||||
|
||||
// [251106] 패널 액션 큐 관련 reducer 케이스들
|
||||
case types.ENQUEUE_PANEL_ACTION: {
|
||||
console.log('[panelReducer] 🟠 ENQUEUE_PANEL_ACTION', {
|
||||
dlog('[panelReducer] 🟠 ENQUEUE_PANEL_ACTION', {
|
||||
action: action.payload.action,
|
||||
queueId: action.payload.id,
|
||||
currentQueueLength: state.panelActionQueue.length,
|
||||
@@ -201,7 +216,7 @@ export const panelsReducer = (state = initialState, action) => {
|
||||
}
|
||||
|
||||
case types.PROCESS_PANEL_QUEUE: {
|
||||
console.log('[panelReducer] 🟡 PROCESS_PANEL_QUEUE', {
|
||||
dlog('[panelReducer] 🟡 PROCESS_PANEL_QUEUE', {
|
||||
isProcessing: state.isProcessingQueue,
|
||||
queueLength: state.panelActionQueue.length,
|
||||
});
|
||||
@@ -215,7 +230,7 @@ export const panelsReducer = (state = initialState, action) => {
|
||||
const firstQueueItem = state.panelActionQueue[0];
|
||||
const remainingQueue = state.panelActionQueue.slice(1);
|
||||
|
||||
console.log('[panelReducer] 🟡 PROCESSING_QUEUE_ITEM', {
|
||||
dlog('[panelReducer] 🟡 PROCESSING_QUEUE_ITEM', {
|
||||
action: firstQueueItem.action,
|
||||
queueId: firstQueueItem.id,
|
||||
remainingQueueLength: remainingQueue.length,
|
||||
@@ -261,7 +276,7 @@ export const panelsReducer = (state = initialState, action) => {
|
||||
break;
|
||||
}
|
||||
default:
|
||||
console.warn('[panelReducer] ⚠️ UNKNOWN_QUEUE_ACTION', firstQueueItem.action);
|
||||
dwarn('[panelReducer] ⚠️ UNKNOWN_QUEUE_ACTION', firstQueueItem.action);
|
||||
newState = state;
|
||||
}
|
||||
|
||||
@@ -272,7 +287,7 @@ export const panelsReducer = (state = initialState, action) => {
|
||||
processingTime) /
|
||||
newTotalProcessed;
|
||||
|
||||
console.log('[panelReducer] ✅ QUEUE_ITEM_PROCESSED', {
|
||||
dlog('[panelReducer] ✅ QUEUE_ITEM_PROCESSED', {
|
||||
action: firstQueueItem.action,
|
||||
queueId: firstQueueItem.id,
|
||||
processingTime,
|
||||
@@ -290,7 +305,7 @@ export const panelsReducer = (state = initialState, action) => {
|
||||
},
|
||||
};
|
||||
} catch (error) {
|
||||
console.error('[panelReducer] ❌ QUEUE_PROCESSING_ERROR', {
|
||||
derror('[panelReducer] ❌ QUEUE_PROCESSING_ERROR', {
|
||||
action: firstQueueItem.action,
|
||||
queueId: firstQueueItem.id,
|
||||
error: error.message,
|
||||
@@ -315,7 +330,7 @@ export const panelsReducer = (state = initialState, action) => {
|
||||
}
|
||||
|
||||
case types.CLEAR_PANEL_QUEUE: {
|
||||
console.log('[panelReducer] 🔵 CLEAR_PANEL_QUEUE', {
|
||||
dlog('[panelReducer] 🔵 CLEAR_PANEL_QUEUE', {
|
||||
currentQueueLength: state.panelActionQueue.length,
|
||||
});
|
||||
|
||||
@@ -328,7 +343,7 @@ export const panelsReducer = (state = initialState, action) => {
|
||||
}
|
||||
|
||||
case types.SET_QUEUE_PROCESSING: {
|
||||
console.log('[panelReducer] 🟣 SET_QUEUE_PROCESSING', {
|
||||
dlog('[panelReducer] 🟣 SET_QUEUE_PROCESSING', {
|
||||
isProcessing: action.payload.isProcessing,
|
||||
queueLength: state.panelActionQueue.length,
|
||||
});
|
||||
@@ -341,7 +356,7 @@ export const panelsReducer = (state = initialState, action) => {
|
||||
|
||||
// [251106] 비동기 패널 액션 관련 reducer 케이스들
|
||||
case types.ENQUEUE_ASYNC_PANEL_ACTION: {
|
||||
console.log('[panelReducer] 🟠 ENQUEUE_ASYNC_PANEL_ACTION', {
|
||||
dlog('[panelReducer] 🟠 ENQUEUE_ASYNC_PANEL_ACTION', {
|
||||
actionId: action.payload.id,
|
||||
timestamp: action.payload.timestamp,
|
||||
});
|
||||
@@ -361,7 +376,7 @@ export const panelsReducer = (state = initialState, action) => {
|
||||
}
|
||||
|
||||
case types.COMPLETE_ASYNC_PANEL_ACTION: {
|
||||
console.log('[panelReducer] ✅ COMPLETE_ASYNC_PANEL_ACTION', {
|
||||
dlog('[panelReducer] ✅ COMPLETE_ASYNC_PANEL_ACTION', {
|
||||
actionId: action.payload.actionId,
|
||||
timestamp: action.payload.timestamp,
|
||||
});
|
||||
@@ -401,7 +416,7 @@ export const panelsReducer = (state = initialState, action) => {
|
||||
}
|
||||
|
||||
case types.FAIL_ASYNC_PANEL_ACTION: {
|
||||
console.log('[panelReducer] ❌ FAIL_ASYNC_PANEL_ACTION', {
|
||||
derror('[panelReducer] ❌ FAIL_ASYNC_PANEL_ACTION', {
|
||||
actionId: action.payload.actionId,
|
||||
error: action.payload.error?.message || 'Unknown error',
|
||||
timestamp: action.payload.timestamp,
|
||||
@@ -440,7 +455,7 @@ export const panelsReducer = (state = initialState, action) => {
|
||||
|
||||
// [251114] 명시적 포커스 이동
|
||||
case types.FOCUS_PANEL: {
|
||||
console.log('[panelReducer] 🎯 FOCUS_PANEL', {
|
||||
dlog('[panelReducer] 🎯 FOCUS_PANEL', {
|
||||
panelName: action.payload.panelName,
|
||||
focusTarget: action.payload.focusTarget,
|
||||
timestamp: action.payload.timestamp,
|
||||
|
||||
Reference in New Issue
Block a user