[251124] fix: App.js 로그 정리 및 최적화
🕐 커밋 시간: 2025. 11. 24. 09:08:54 📊 변경 통계: • 총 파일: 10개 • 추가: +93줄 • 삭제: -97줄 📝 수정된 파일: ~ com.twin.app.shoptime/src/App/App.js ~ com.twin.app.shoptime/src/components/MediaItem/MediaItem.module.less ~ com.twin.app.shoptime/src/components/MobileSend/PhoneInputSection.module.less ~ com.twin.app.shoptime/src/components/TPopUp/TNewPopUp.module.less ~ com.twin.app.shoptime/src/hooks/useVideoPlay/useVideoPlay.js ~ com.twin.app.shoptime/src/views/DetailPanel/ProductOverview/ProductOverview.module.less ~ com.twin.app.shoptime/src/views/MediaPanel/MediaPanel.jsx ~ com.twin.app.shoptime/src/views/MediaPanel/MediaPanel.v3.jsx ~ com.twin.app.shoptime/src/views/MyPagePanel/MyPageSub/TermsOfService/TermsOfOptional.module copy.less ~ com.twin.app.shoptime/src/views/PlayerPanel/PlayerPanel.jsx 🔧 함수 변경 내용: 📄 com.twin.app.shoptime/src/App/App.js (javascript): 🔄 Modified: resolveSpotlightIdFromEvent() ❌ Deleted: handleFocusLog(), handleBlurLog() 📄 com.twin.app.shoptime/src/views/MediaPanel/MediaPanel.v3.jsx (javascript): 🔄 Modified: normalizeModalStyle() 🔧 주요 변경 내용: • 핵심 비즈니스 로직 개선 • UI 컴포넌트 아키텍처 개선 • API 서비스 레이어 개선 Performance: 코드 최적화로 성능 개선 기대
This commit is contained in:
@@ -465,56 +465,55 @@ function AppBase(props) {
|
||||
// const termsFlag = useSelector((state) => state.common.termsFlag);
|
||||
const termsData = useSelector((state) => state.home.termsData);
|
||||
|
||||
// 🔽 Spotlight focus/blur 로그 (옵션)
|
||||
useEffect(() => {
|
||||
if (!Config.FOCUS_DEBUG) {
|
||||
return undefined;
|
||||
}
|
||||
// // 🔽 Spotlight focus/blur 로그 (옵션)
|
||||
// useEffect(() => {
|
||||
// if (!Config.FOCUS_DEBUG) {
|
||||
// return undefined;
|
||||
// }
|
||||
|
||||
const handleFocusLog = (event) => {
|
||||
const spotlightId = resolveSpotlightIdFromEvent(event);
|
||||
if (!spotlightId || spotlightId === lastLoggedSpotlightId) {
|
||||
return;
|
||||
}
|
||||
console.log(`[SpotlightFocus] focus - ${spotlightId}`);
|
||||
lastLoggedSpotlightId = spotlightId;
|
||||
};
|
||||
// const handleFocusLog = (event) => {
|
||||
// const spotlightId = resolveSpotlightIdFromEvent(event);
|
||||
// if (!spotlightId || spotlightId === lastLoggedSpotlightId) {
|
||||
// return;
|
||||
// }
|
||||
// console.log(`[SpotlightFocus] focus - ${spotlightId}`);
|
||||
// lastLoggedSpotlightId = spotlightId;
|
||||
// };
|
||||
|
||||
const handleBlurLog = (event) => {
|
||||
const spotlightId = resolveSpotlightIdFromEvent(event);
|
||||
if (!spotlightId || spotlightId === lastLoggedBlurSpotlightId) {
|
||||
return;
|
||||
}
|
||||
console.log(`[SpotlightFocus] blur - ${spotlightId}`);
|
||||
lastLoggedBlurSpotlightId = spotlightId;
|
||||
};
|
||||
// const handleBlurLog = (event) => {
|
||||
// const spotlightId = resolveSpotlightIdFromEvent(event);
|
||||
// if (!spotlightId || spotlightId === lastLoggedBlurSpotlightId) {
|
||||
// return;
|
||||
// }
|
||||
// console.log(`[SpotlightFocus] blur - ${spotlightId}`);
|
||||
// lastLoggedBlurSpotlightId = spotlightId;
|
||||
// };
|
||||
|
||||
const hasSpotlightListener = typeof Spotlight.addEventListener === 'function';
|
||||
if (hasSpotlightListener) {
|
||||
Spotlight.addEventListener('focus', handleFocusLog);
|
||||
Spotlight.addEventListener('blur', handleBlurLog);
|
||||
// const hasSpotlightListener = typeof Spotlight.addEventListener === 'function';
|
||||
// if (hasSpotlightListener) {
|
||||
// Spotlight.addEventListener('focus', handleFocusLog);
|
||||
// Spotlight.addEventListener('blur', handleBlurLog);
|
||||
|
||||
return () => {
|
||||
Spotlight.removeEventListener('focus', handleFocusLog);
|
||||
Spotlight.removeEventListener('blur', handleBlurLog);
|
||||
};
|
||||
}
|
||||
// return () => {
|
||||
// Spotlight.removeEventListener('focus', handleFocusLog);
|
||||
// Spotlight.removeEventListener('blur', handleBlurLog);
|
||||
// };
|
||||
// }
|
||||
|
||||
if (typeof document !== 'undefined') {
|
||||
document.addEventListener('spotlightfocus', handleFocusLog);
|
||||
document.addEventListener('spotlightblur', handleBlurLog);
|
||||
// if (typeof document !== 'undefined') {
|
||||
// document.addEventListener('spotlightfocus', handleFocusLog);
|
||||
// document.addEventListener('spotlightblur', handleBlurLog);
|
||||
|
||||
return () => {
|
||||
document.removeEventListener('spotlightfocus', handleFocusLog);
|
||||
document.removeEventListener('spotlightblur', handleBlurLog);
|
||||
};
|
||||
}
|
||||
// return () => {
|
||||
// document.removeEventListener('spotlightfocus', handleFocusLog);
|
||||
// document.removeEventListener('spotlightblur', handleBlurLog);
|
||||
// };
|
||||
// }
|
||||
|
||||
return undefined;
|
||||
}, [Config.FOCUS_DEBUG]);
|
||||
// return undefined;
|
||||
// }, [Config.FOCUS_DEBUG]);
|
||||
|
||||
useEffect(() => {
|
||||
// Chromium68 호환성을 위해 Optional Chaining 제거
|
||||
if (termsData && termsData.data && termsData.data.terms) {
|
||||
dispatch(getTermsAgreeYn());
|
||||
}
|
||||
@@ -525,7 +524,6 @@ function AppBase(props) {
|
||||
const oldDb8Deleted = useSelector((state) => state.localSettings.oldDb8Deleted);
|
||||
// const macAddress = useSelector((state) => state.common.macAddress);
|
||||
|
||||
// Chromium68 호환성을 위해 Optional Chaining 제거
|
||||
const deviceCountryCode = (httpHeader && httpHeader['X-Device-Country']) || '';
|
||||
|
||||
useEffect(() => {
|
||||
@@ -581,11 +579,11 @@ function AppBase(props) {
|
||||
// appinfo
|
||||
// );
|
||||
|
||||
console.log('[App.js] initService,httpHeaderRef.current', httpHeaderRef.current);
|
||||
console.log('[App.js] haveyInit', haveyInit);
|
||||
// console.log('[App.js] initService,httpHeaderRef.current', httpHeaderRef.current);
|
||||
// console.log('[App.js] haveyInit', haveyInit);
|
||||
|
||||
// 앱 초기화 시 HomePanel 자동 기록
|
||||
console.log('[App.js] Recording initial HomePanel on app start');
|
||||
// console.log('[App.js] Recording initial HomePanel on app start');
|
||||
dispatch(
|
||||
enqueuePanelHistory(
|
||||
'homepanel',
|
||||
@@ -618,11 +616,11 @@ function AppBase(props) {
|
||||
|
||||
const launchParams = getLaunchParams();
|
||||
|
||||
console.log(
|
||||
'initService...{haveyInit, launchParams}',
|
||||
haveyInit,
|
||||
JSON.stringify(launchParams)
|
||||
);
|
||||
// console.log(
|
||||
// 'initService...{haveyInit, launchParams}',
|
||||
// haveyInit,
|
||||
// JSON.stringify(launchParams)
|
||||
// );
|
||||
|
||||
// pyh TODO: edit or delete later (line 196 ~ 198)
|
||||
// Chromium68 호환성을 위해 Optional Chaining 제거
|
||||
@@ -656,7 +654,7 @@ function AppBase(props) {
|
||||
);
|
||||
|
||||
const handleRelaunchEvent = useCallback(() => {
|
||||
console.log('[App] handleRelaunchEvent triggered');
|
||||
// console.log('[App] handleRelaunchEvent triggered');
|
||||
|
||||
const launchParams = getLaunchParams();
|
||||
clearLaunchParams();
|
||||
@@ -709,8 +707,8 @@ function AppBase(props) {
|
||||
}, [initService, introTermsAgreeRef, dispatch]);
|
||||
|
||||
const visibilityChanged = useCallback(() => {
|
||||
console.log('document is hidden', document.hidden);
|
||||
console.log('document.visibilityState= ', document.visibilityState);
|
||||
// console.log('document is hidden', document.hidden);
|
||||
// console.log('document.visibilityState= ', document.visibilityState);
|
||||
if (document.hidden && typeof window === 'object') {
|
||||
clearTimeout(foreGroundChangeTimer);
|
||||
} else {
|
||||
@@ -718,13 +716,13 @@ function AppBase(props) {
|
||||
// set foreground flag using delay time.
|
||||
clearTimeout(foreGroundChangeTimer);
|
||||
foreGroundChangeTimer = setTimeout(() => {
|
||||
console.log(
|
||||
'visibility changed !!! ==> set to foreground cursorVisible',
|
||||
// Chromium68 호환성을 위해 Optional Chaining 제거
|
||||
JSON.stringify(
|
||||
window.PalmSystem && window.PalmSystem.cursor && window.PalmSystem.cursor.visibility
|
||||
)
|
||||
); // eslint-disable-line no-console
|
||||
// console.log(
|
||||
// 'visibility changed !!! ==> set to foreground cursorVisible',
|
||||
// // Chromium68 호환성을 위해 Optional Chaining 제거
|
||||
// JSON.stringify(
|
||||
// window.PalmSystem && window.PalmSystem.cursor && window.PalmSystem.cursor.visibility
|
||||
// )
|
||||
// ); // eslint-disable-line no-console
|
||||
if (platform.platformName !== 'webos') {
|
||||
//for debug
|
||||
dispatch(
|
||||
|
||||
Reference in New Issue
Block a user