[251122] fix: Comment정리-2
🕐 커밋 시간: 2025. 11. 22. 18:35:56 📊 변경 통계: • 총 파일: 6개 • 추가: +129줄 • 삭제: -100줄 📝 수정된 파일: ~ com.twin.app.shoptime/src/App/App.js ~ com.twin.app.shoptime/src/actions/productActions.js ~ com.twin.app.shoptime/src/api/TAxios.js ~ com.twin.app.shoptime/src/utils/panelUtils.js ~ com.twin.app.shoptime/src/views/HomePanel/HomeBanner/RandomUnit.jsx ~ com.twin.app.shoptime/src/views/TrendingNowPanel/PopularShow/PopularVideoPlayer/PopularVideoPlayer.jsx 🔧 함수 변경 내용: 📄 com.twin.app.shoptime/src/App/App.js (javascript): 🔄 Modified: sendVoiceLogToPanel() ❌ Deleted: resolveSpotlightIdFromNode() 📄 com.twin.app.shoptime/src/actions/productActions.js (javascript): ✅ Added: onSuccess() 🔄 Modified: pickParams(), createGetThunk() ❌ Deleted: onSuccess() 📄 com.twin.app.shoptime/src/api/TAxios.js (javascript): 🔄 Modified: runDelayedAction() 📄 com.twin.app.shoptime/src/views/HomePanel/HomeBanner/RandomUnit.jsx (javascript): 🔄 Modified: SpotlightContainerDecorator() 🔧 주요 변경 내용: • 핵심 비즈니스 로직 개선 • API 서비스 레이어 개선 • 공통 유틸리티 함수 최적화
This commit is contained in:
@@ -72,6 +72,9 @@ import { types } from '../actions/actionTypes';
|
||||
// } from "../utils/focus-monitor";
|
||||
// import { PanelHoc } from "../components/TPanel/TPanel";
|
||||
|
||||
// DEBUG_MODE - true인 경우에만 로그 출력
|
||||
const DEBUG_MODE = false;
|
||||
|
||||
let foreGroundChangeTimer = null;
|
||||
|
||||
// 기존 콘솔 메서드를 백업
|
||||
@@ -185,86 +188,92 @@ const sendVoiceLogToPanel = (args) => {
|
||||
};
|
||||
|
||||
console.log = function (...args) {
|
||||
// Voice 로그를 VoicePanel로 전송
|
||||
sendVoiceLogToPanel(args);
|
||||
// 원래 console.log 실행
|
||||
originalConsoleLog.apply(console, processArgs(args));
|
||||
if (DEBUG_MODE) {
|
||||
// Voice 로그를 VoicePanel로 전송
|
||||
sendVoiceLogToPanel(args);
|
||||
// 원래 console.log 실행
|
||||
originalConsoleLog.apply(console, processArgs(args));
|
||||
}
|
||||
};
|
||||
|
||||
console.error = function (...args) {
|
||||
// Voice 로그를 VoicePanel로 전송 (에러는 강제로 ERROR 타입)
|
||||
try {
|
||||
const firstArg = args[0];
|
||||
if (
|
||||
typeof firstArg === 'string' &&
|
||||
(firstArg.includes('[Voice]') || firstArg.includes('[VoiceConductor]'))
|
||||
) {
|
||||
const logData = {};
|
||||
if (args.length > 1) {
|
||||
args.slice(1).forEach((arg, index) => {
|
||||
if (typeof arg === 'object') {
|
||||
Object.assign(logData, arg);
|
||||
} else {
|
||||
logData[`arg${index + 1}`] = arg;
|
||||
}
|
||||
if (DEBUG_MODE) {
|
||||
// Voice 로그를 VoicePanel로 전송 (에러는 강제로 ERROR 타입)
|
||||
try {
|
||||
const firstArg = args[0];
|
||||
if (
|
||||
typeof firstArg === 'string' &&
|
||||
(firstArg.includes('[Voice]') || firstArg.includes('[VoiceConductor]'))
|
||||
) {
|
||||
const logData = {};
|
||||
if (args.length > 1) {
|
||||
args.slice(1).forEach((arg, index) => {
|
||||
if (typeof arg === 'object') {
|
||||
Object.assign(logData, arg);
|
||||
} else {
|
||||
logData[`arg${index + 1}`] = arg;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
store.dispatch({
|
||||
type: types.VOICE_ADD_LOG,
|
||||
payload: {
|
||||
timestamp: new Date().toISOString(),
|
||||
type: 'ERROR',
|
||||
title: firstArg.replace(/^\[Voice\]\s*/, '').replace(/^\[VoiceConductor\]\s*/, ''),
|
||||
data: Object.keys(logData).length > 0 ? logData : { message: firstArg },
|
||||
success: false,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
store.dispatch({
|
||||
type: types.VOICE_ADD_LOG,
|
||||
payload: {
|
||||
timestamp: new Date().toISOString(),
|
||||
type: 'ERROR',
|
||||
title: firstArg.replace(/^\[Voice\]\s*/, '').replace(/^\[VoiceConductor\]\s*/, ''),
|
||||
data: Object.keys(logData).length > 0 ? logData : { message: firstArg },
|
||||
success: false,
|
||||
},
|
||||
});
|
||||
} catch (error) {
|
||||
originalConsoleError.call(console, '[VoiceLog] Error sending error to panel:', error);
|
||||
}
|
||||
} catch (error) {
|
||||
originalConsoleError.call(console, '[VoiceLog] Error sending error to panel:', error);
|
||||
}
|
||||
|
||||
originalConsoleError.apply(console, processArgs(args));
|
||||
originalConsoleError.apply(console, processArgs(args));
|
||||
}
|
||||
};
|
||||
|
||||
console.warn = function (...args) {
|
||||
// Voice 로그를 VoicePanel로 전송 (경고는 ERROR 타입으로)
|
||||
try {
|
||||
const firstArg = args[0];
|
||||
if (
|
||||
typeof firstArg === 'string' &&
|
||||
(firstArg.includes('[Voice]') || firstArg.includes('[VoiceConductor]'))
|
||||
) {
|
||||
const logData = {};
|
||||
if (args.length > 1) {
|
||||
args.slice(1).forEach((arg, index) => {
|
||||
if (typeof arg === 'object') {
|
||||
Object.assign(logData, arg);
|
||||
} else {
|
||||
logData[`arg${index + 1}`] = arg;
|
||||
}
|
||||
if (DEBUG_MODE) {
|
||||
// Voice 로그를 VoicePanel로 전송 (경고는 ERROR 타입으로)
|
||||
try {
|
||||
const firstArg = args[0];
|
||||
if (
|
||||
typeof firstArg === 'string' &&
|
||||
(firstArg.includes('[Voice]') || firstArg.includes('[VoiceConductor]'))
|
||||
) {
|
||||
const logData = {};
|
||||
if (args.length > 1) {
|
||||
args.slice(1).forEach((arg, index) => {
|
||||
if (typeof arg === 'object') {
|
||||
Object.assign(logData, arg);
|
||||
} else {
|
||||
logData[`arg${index + 1}`] = arg;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
store.dispatch({
|
||||
type: types.VOICE_ADD_LOG,
|
||||
payload: {
|
||||
timestamp: new Date().toISOString(),
|
||||
type: 'ERROR',
|
||||
title:
|
||||
'WARNING: ' +
|
||||
firstArg.replace(/^\[Voice\]\s*/, '').replace(/^\[VoiceConductor\]\s*/, ''),
|
||||
data: Object.keys(logData).length > 0 ? logData : { message: firstArg },
|
||||
success: false,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
store.dispatch({
|
||||
type: types.VOICE_ADD_LOG,
|
||||
payload: {
|
||||
timestamp: new Date().toISOString(),
|
||||
type: 'ERROR',
|
||||
title:
|
||||
'WARNING: ' +
|
||||
firstArg.replace(/^\[Voice\]\s*/, '').replace(/^\[VoiceConductor\]\s*/, ''),
|
||||
data: Object.keys(logData).length > 0 ? logData : { message: firstArg },
|
||||
success: false,
|
||||
},
|
||||
});
|
||||
} catch (error) {
|
||||
originalConsoleWarn.call(console, '[VoiceLog] Error sending warning to panel:', error);
|
||||
}
|
||||
} catch (error) {
|
||||
originalConsoleWarn.call(console, '[VoiceLog] Error sending warning to panel:', error);
|
||||
}
|
||||
|
||||
originalConsoleWarn.apply(console, processArgs(args));
|
||||
originalConsoleWarn.apply(console, processArgs(args));
|
||||
}
|
||||
};
|
||||
|
||||
const originFocus = Spotlight.focus;
|
||||
@@ -304,12 +313,12 @@ const logFocusTransition = (previousNode, currentNode) => {
|
||||
const currentId = resolveSpotlightIdFromNode(currentNode);
|
||||
|
||||
if (previousId && previousId !== currentId) {
|
||||
console.log(`[SpotlightFocus] blur - ${previousId}`);
|
||||
if (DEBUG_MODE) console.log(`[SpotlightFocus] blur - ${previousId}`);
|
||||
lastLoggedBlurSpotlightId = previousId;
|
||||
}
|
||||
|
||||
if (currentId && currentId !== lastLoggedSpotlightId) {
|
||||
console.log(`[SpotlightFocus] focus - ${currentId}`);
|
||||
if (DEBUG_MODE) console.log(`[SpotlightFocus] focus - ${currentId}`);
|
||||
lastLoggedSpotlightId = currentId;
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user