[251126] fix: Remove Lint warinings - 1
🕐 커밋 시간: 2025. 11. 26. 14:59:11 📊 변경 통계: • 총 파일: 12개 • 추가: +47줄 • 삭제: -50줄 📝 수정된 파일: ~ com.twin.app.shoptime/src/App/App.js ~ com.twin.app.shoptime/src/App/deepLinkHandler.js ~ com.twin.app.shoptime/src/actions/appDataActions.js ~ com.twin.app.shoptime/src/actions/billingActions.js ~ com.twin.app.shoptime/src/actions/brandActions.js ~ com.twin.app.shoptime/src/actions/cancelActions.js ~ com.twin.app.shoptime/src/actions/cardActions.js ~ com.twin.app.shoptime/src/actions/checkoutActions.js ~ com.twin.app.shoptime/src/actions/commonActions.js ~ com.twin.app.shoptime/src/actions/convertActions.js ~ com.twin.app.shoptime/src/actions/couponActions.js ~ com.twin.app.shoptime/src/views/UserReview/UserReviewPanel.jsx 🔧 주요 변경 내용: • 핵심 비즈니스 로직 개선 • 소규모 기능 개선 • 코드 정리 및 최적화 • 모듈 구조 개선 Performance: 코드 최적화로 성능 개선 기대
This commit is contained in:
@@ -18,7 +18,6 @@ import { ThemeDecorator } from '@enact/sandstone/ThemeDecorator';
|
||||
|
||||
import {
|
||||
changeAppStatus,
|
||||
changeLocalSettings,
|
||||
// cancelFocusElement,
|
||||
// focusElement,
|
||||
// setExitApp,
|
||||
@@ -280,7 +279,7 @@ const originFocus = Spotlight.focus;
|
||||
const originMove = Spotlight.move;
|
||||
const originSilentlyFocus = Spotlight.silentlyFocus;
|
||||
let lastLoggedSpotlightId = null;
|
||||
let lastLoggedBlurSpotlightId = null;
|
||||
let lastLoggedBlurSpotlightId = null; // eslint-disable-line no-unused-vars
|
||||
let focusLoggingSuppressed = 0;
|
||||
|
||||
const resolveSpotlightIdFromNode = (node) => {
|
||||
@@ -427,7 +426,7 @@ Spotlight.silentlyFocus = function (...args) {
|
||||
// });
|
||||
// }
|
||||
|
||||
function AppBase(_props) {
|
||||
function AppBase(_props /* eslint-disable-line no-unused-vars */) {
|
||||
const dispatch = useDispatch();
|
||||
const httpHeader = useSelector((state) => state.common.httpHeader);
|
||||
const httpHeaderRef = useRef(httpHeader);
|
||||
@@ -629,7 +628,7 @@ function AppBase(_props) {
|
||||
clearLaunchParams();
|
||||
}
|
||||
},
|
||||
[/* dispatch */]
|
||||
[dispatch],
|
||||
);
|
||||
|
||||
const handleRelaunchEvent = useCallback(() => {
|
||||
@@ -683,7 +682,7 @@ function AppBase(_props) {
|
||||
if (typeof window === 'object' && window.PalmSystem) {
|
||||
window.PalmSystem.activate();
|
||||
}
|
||||
}, [initService, introTermsAgreeRef /*, dispatch */]);
|
||||
}, [initService, introTermsAgreeRef]);
|
||||
|
||||
const visibilityChanged = useCallback(() => {
|
||||
// console.log('document is hidden', document.hidden);
|
||||
@@ -727,7 +726,7 @@ function AppBase(_props) {
|
||||
}, [dispatch]);
|
||||
|
||||
useEffect(() => {
|
||||
const keyDownEvent = (_event) => {
|
||||
const keyDownEvent = (_event /* eslint-disable-line no-unused-vars */) => {
|
||||
dispatch(changeAppStatus({ cursorVisible: false }));
|
||||
Spotlight.setPointerMode(false);
|
||||
};
|
||||
@@ -736,7 +735,7 @@ function AppBase(_props) {
|
||||
let lastMoveTime = 0;
|
||||
const THROTTLE_MS = 100;
|
||||
|
||||
const mouseMoveEvent = (_event) => {
|
||||
const mouseMoveEvent = (_event /* eslint-disable-line no-unused-vars */) => {
|
||||
const now = Date.now();
|
||||
if (now - lastMoveTime < THROTTLE_MS) {
|
||||
// throttle 기간 내에는 hideCursor만 재시작
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { useDispatch } from "react-redux";
|
||||
|
||||
import { updateHomeInfo } from "../actions/homeActions";
|
||||
import { pushPanel } from "../actions/panelActions";
|
||||
import {
|
||||
@@ -11,7 +11,7 @@ import { SpotlightIds } from "../utils/SpotlightIds";
|
||||
import { sendLogTotalRecommend } from "../actions/logActions";
|
||||
|
||||
//V2_진입경로코드_진입경로명_MT_노출순번
|
||||
export const handleDeepLink = (contentTarget) => (dispatch, getState) => {
|
||||
export const handleDeepLink = (contentTarget) => (dispatch, _getState) => {
|
||||
console.log("[handleDeepLink] ~ contentTarget: ", contentTarget);
|
||||
let linkTpCd; // 진입경로코드
|
||||
let linkTpNm; // 진입경로명
|
||||
@@ -21,7 +21,6 @@ export const handleDeepLink = (contentTarget) => (dispatch, getState) => {
|
||||
let curationId; // 큐레이션아이디
|
||||
let showId; // 방송아이디
|
||||
let chanId; // 채널아이디
|
||||
let expsOrd; // 노출순번
|
||||
let grNumber; // 그룹번호
|
||||
let evntId; // 이벤트아이디
|
||||
let lgCatCd; // LG카테고리Code
|
||||
@@ -65,7 +64,6 @@ export const handleDeepLink = (contentTarget) => (dispatch, getState) => {
|
||||
// V3_진입경로코드_진입경로명_PD_파트너아이디_상품아이디_노출순번_큐레이션아이디
|
||||
patnrId = tokens[4]; // 파트너아이디
|
||||
prdtId = tokens[5]; // 상품아이디
|
||||
expsOrd = tokens[6]; // 노출순번
|
||||
curationId = tokens[7]; // 큐레이션아이디
|
||||
panelName = panel_names.DETAIL_PANEL;
|
||||
deeplinkPanel = "Product Detaoil";
|
||||
@@ -81,7 +79,6 @@ export const handleDeepLink = (contentTarget) => (dispatch, getState) => {
|
||||
// V3_진입경로코드_진입경로명_LS_파트너아이디_채널아이디_노출순번_큐레이션아이디
|
||||
patnrId = tokens[4]; // 파트너아이디
|
||||
chanId = tokens[5]; // 채널아이디
|
||||
expsOrd = tokens[6]; // 노출순번
|
||||
curationId = tokens[7]; // 큐레이션아이디
|
||||
panelName = panel_names.PLAYER_PANEL;
|
||||
deeplinkPanel = "Live Show";
|
||||
@@ -98,7 +95,6 @@ export const handleDeepLink = (contentTarget) => (dispatch, getState) => {
|
||||
// V3_진입경로코드_진입경로명_VS_파트너아이디_방송아이디_노출순번_큐레이션아이디
|
||||
patnrId = tokens[4]; // 파트너아이디
|
||||
showId = tokens[5]; // 방송아이디
|
||||
expsOrd = tokens[6]; // 노출순번
|
||||
curationId = tokens[7]; // 큐레이션아이디
|
||||
panelName = panel_names.PLAYER_PANEL;
|
||||
deeplinkPanel = "VOD Show";
|
||||
@@ -119,7 +115,6 @@ export const handleDeepLink = (contentTarget) => (dispatch, getState) => {
|
||||
patnrId = tokens[4]; // 파트너아이디
|
||||
curationId = tokens[5]; // 큐레이션아이디\
|
||||
prdtId = tokens[6]; // 상품아이디
|
||||
expsOrd = tokens[7]; // 노출순번
|
||||
grNumber = tokens[8]; // 그룹번호
|
||||
panelName = panel_names.DETAIL_PANEL;
|
||||
deeplinkPanel = "Theme Detail";
|
||||
@@ -140,7 +135,6 @@ export const handleDeepLink = (contentTarget) => (dispatch, getState) => {
|
||||
|
||||
patnrId = tokens[4]; // 파트너아이디
|
||||
curationId = tokens[5]; // 큐레이션아이디
|
||||
expsOrd = tokens[6]; // 노출순번
|
||||
panelName = panel_names.DETAIL_PANEL;
|
||||
deeplinkPanel = "Hotel Detail";
|
||||
panelInfo = {
|
||||
@@ -157,7 +151,6 @@ export const handleDeepLink = (contentTarget) => (dispatch, getState) => {
|
||||
|
||||
patnrId = tokens[4]; // 파트너아이디
|
||||
curationId = tokens[5]; // 큐레이션아이디
|
||||
expsOrd = tokens[6]; // 노출순번
|
||||
panelName = panel_names.HOT_PICKS_PANEL;
|
||||
deeplinkPanel = "Hot Picks";
|
||||
panelInfo = {
|
||||
|
||||
@@ -5,7 +5,7 @@ import { createDebugHelpers } from '../utils/debug';
|
||||
|
||||
// 디버그 헬퍼 설정
|
||||
const DEBUG_MODE = false;
|
||||
const { dlog, dwarn, derror } = createDebugHelpers(DEBUG_MODE);
|
||||
const { dlog, derror } = createDebugHelpers(DEBUG_MODE);
|
||||
|
||||
export const addMainIndex = (index) => ({
|
||||
type: types.ADD_MAIN_INDEX,
|
||||
|
||||
@@ -5,7 +5,7 @@ import { createDebugHelpers } from '../utils/debug';
|
||||
|
||||
// 디버그 헬퍼 설정
|
||||
const DEBUG_MODE = false;
|
||||
const { dlog, dwarn, derror } = createDebugHelpers(DEBUG_MODE);
|
||||
const { dlog, derror } = createDebugHelpers(DEBUG_MODE);
|
||||
|
||||
// IF-LGSP-328 : 회원 Billing Address 조회
|
||||
export const getMyInfoBillingSearch = (props) => (dispatch, getState) => {
|
||||
|
||||
@@ -6,7 +6,7 @@ import { createDebugHelpers } from '../utils/debug';
|
||||
|
||||
// 디버그 헬퍼 설정
|
||||
const DEBUG_MODE = false;
|
||||
const { dlog, dwarn, derror } = createDebugHelpers(DEBUG_MODE);
|
||||
const { derror } = createDebugHelpers(DEBUG_MODE);
|
||||
|
||||
// Featured Brands 정보 조회 IF-LGSP-304
|
||||
export const getBrandList = () => (dispatch, getState) => {
|
||||
|
||||
@@ -6,7 +6,7 @@ import { createDebugHelpers } from '../utils/debug';
|
||||
|
||||
// 디버그 헬퍼 설정
|
||||
const DEBUG_MODE = false;
|
||||
const { dlog, dwarn, derror } = createDebugHelpers(DEBUG_MODE);
|
||||
const { dlog, derror } = createDebugHelpers(DEBUG_MODE);
|
||||
|
||||
// 회원 주문 취소/반품/교환 사유 조회 (IF-LGSP-347)
|
||||
export const getMyinfoOrderCancelColumnsSearch = (params, callback) => (dispatch, getState) => {
|
||||
|
||||
@@ -5,7 +5,7 @@ import { createDebugHelpers } from '../utils/debug';
|
||||
|
||||
// 디버그 헬퍼 설정
|
||||
const DEBUG_MODE = false;
|
||||
const { dlog, dwarn, derror } = createDebugHelpers(DEBUG_MODE);
|
||||
const { dlog, derror } = createDebugHelpers(DEBUG_MODE);
|
||||
|
||||
// 회원의 등록 카드 정보 조회 IF-LGSP-332
|
||||
export const getMyInfoCardSearch = (props) => (dispatch, getState) => {
|
||||
|
||||
@@ -6,7 +6,7 @@ import { createDebugHelpers } from '../utils/debug';
|
||||
|
||||
// 디버그 헬퍼 설정
|
||||
const DEBUG_MODE = false;
|
||||
const { dlog, dwarn, derror } = createDebugHelpers(DEBUG_MODE);
|
||||
const { dlog, derror } = createDebugHelpers(DEBUG_MODE);
|
||||
|
||||
// 회원 체크아웃 정보 조회 IF-LGSP-345
|
||||
export const getMyInfoCheckoutInfo = (props, callback) => (dispatch, getState) => {
|
||||
|
||||
@@ -114,7 +114,7 @@ export const loadingComplete = (status) => ({
|
||||
payload: status,
|
||||
});
|
||||
|
||||
export const alertToast = (payload) => (dispatch, getState) => {
|
||||
export const alertToast = (payload) => (dispatch) => {
|
||||
if (typeof window === 'object' && !window.PalmSystem) {
|
||||
dispatch(changeAppStatus({ toast: true, toastText: payload }));
|
||||
} else {
|
||||
|
||||
@@ -31,7 +31,7 @@ export const convertPdfToImage =
|
||||
const timeoutError = new Error(
|
||||
`Conversion timeout after ${timeout}ms (attempt ${attempts})`
|
||||
);
|
||||
dwarn(`⏱️ [EnergyLabel] Timeout on attempt ${attempts}:`, timeoutError.message);
|
||||
void dwarn(`⏱️ [EnergyLabel] Timeout on attempt ${attempts}:`, timeoutError.message);
|
||||
|
||||
// 재시도 가능한 경우
|
||||
if (attempts < maxRetries + 1) {
|
||||
@@ -39,7 +39,7 @@ export const convertPdfToImage =
|
||||
attemptConversion();
|
||||
} else {
|
||||
// 최종 실패
|
||||
derror(`❌ [EnergyLabel] Final failure after ${attempts} attempts:`, pdfUrl);
|
||||
void derror(`❌ [EnergyLabel] Final failure after ${attempts} attempts:`, pdfUrl);
|
||||
dispatch({
|
||||
type: types.CONVERT_PDF_TO_IMAGE_FAILURE,
|
||||
payload: { pdfUrl, error: timeoutError },
|
||||
@@ -64,17 +64,14 @@ export const convertPdfToImage =
|
||||
|
||||
if (retCode !== undefined && retCode !== 0 && retCode !== '0') {
|
||||
const error = new Error(`API Error: retCode=${retCode}`);
|
||||
dwarn(`⚠️ [EnergyLabel] API returned error on attempt ${attempts}:`, retCode);
|
||||
void dwarn(`⚠️ [EnergyLabel] API returned error on attempt ${attempts}:`, retCode);
|
||||
|
||||
// retCode 에러도 재시도
|
||||
if (attempts < maxRetries + 1) {
|
||||
dlog(`🔄 [EnergyLabel] Retrying due to API error... (${attempts}/${maxRetries + 1})`);
|
||||
void dlog(`🔄 [EnergyLabel] Retrying due to API error... (${attempts}/${maxRetries + 1})`);
|
||||
attemptConversion();
|
||||
} else {
|
||||
derror(
|
||||
`❌ [EnergyLabel] Final failure after ${attempts} attempts (API error):`,
|
||||
pdfUrl
|
||||
);
|
||||
void derror(`❌ [EnergyLabel] Final failure after ${attempts} attempts (API error):`, pdfUrl);
|
||||
dispatch({
|
||||
type: types.CONVERT_PDF_TO_IMAGE_FAILURE,
|
||||
payload: { pdfUrl, error },
|
||||
@@ -111,7 +108,7 @@ export const convertPdfToImage =
|
||||
imageUrl = URL.createObjectURL(blob);
|
||||
}
|
||||
|
||||
dlog(`✅ [EnergyLabel] Conversion successful on attempt ${attempts}:`, pdfUrl);
|
||||
void dlog(`✅ [EnergyLabel] Conversion successful on attempt ${attempts}:`, pdfUrl);
|
||||
dispatch({
|
||||
type: types.CONVERT_PDF_TO_IMAGE_SUCCESS,
|
||||
payload: { pdfUrl, imageUrl },
|
||||
@@ -119,16 +116,16 @@ export const convertPdfToImage =
|
||||
|
||||
callback && callback(null, imageUrl);
|
||||
} catch (error) {
|
||||
derror(`❌ [EnergyLabel] Image creation failed on attempt ${attempts}:`, error);
|
||||
void derror(`❌ [EnergyLabel] Image creation failed on attempt ${attempts}:`, error);
|
||||
|
||||
// 이미지 생성 실패도 재시도
|
||||
if (attempts < maxRetries + 1) {
|
||||
dlog(
|
||||
void dlog(
|
||||
`🔄 [EnergyLabel] Retrying due to image creation error... (${attempts}/${maxRetries + 1})`
|
||||
);
|
||||
attemptConversion();
|
||||
} else {
|
||||
derror(
|
||||
void derror(
|
||||
`❌ [EnergyLabel] Final failure after ${attempts} attempts (image error):`,
|
||||
pdfUrl
|
||||
);
|
||||
@@ -147,14 +144,14 @@ export const convertPdfToImage =
|
||||
timeoutId = null;
|
||||
}
|
||||
|
||||
dwarn(`⚠️ [EnergyLabel] Network error on attempt ${attempts}:`, error.message);
|
||||
void dwarn(`⚠️ [EnergyLabel] Network error on attempt ${attempts}:`, error.message);
|
||||
|
||||
// 네트워크 에러도 재시도
|
||||
if (attempts < maxRetries + 1) {
|
||||
dlog(`🔄 [EnergyLabel] Retrying due to network error... (${attempts}/${maxRetries + 1})`);
|
||||
void dlog(`🔄 [EnergyLabel] Retrying due to network error... (${attempts}/${maxRetries + 1})`);
|
||||
attemptConversion();
|
||||
} else {
|
||||
derror(
|
||||
void derror(
|
||||
`❌ [EnergyLabel] Final failure after ${attempts} attempts (network error):`,
|
||||
pdfUrl
|
||||
);
|
||||
@@ -188,7 +185,7 @@ export const convertPdfToImage =
|
||||
* @param {Array<string>} pdfUrls - 변환할 PDF URL 배열
|
||||
* @param {function} callback - 완료 후 실행할 콜백 (errors, results)
|
||||
*/
|
||||
export const convertMultiplePdfs = (pdfUrls, callback) => async (dispatch, getState) => {
|
||||
export const convertMultiplePdfs = (pdfUrls, callback) => async (dispatch) => {
|
||||
if (!pdfUrls || pdfUrls.length === 0) {
|
||||
callback && callback(null, []);
|
||||
return;
|
||||
|
||||
@@ -6,7 +6,7 @@ import { createDebugHelpers } from '../utils/debug';
|
||||
|
||||
// 디버그 헬퍼 설정
|
||||
const DEBUG_MODE = false;
|
||||
const { dlog, dwarn, derror } = createDebugHelpers(DEBUG_MODE);
|
||||
const { dlog, derror } = createDebugHelpers(DEBUG_MODE);
|
||||
|
||||
// IF-LGSP-339 : 회원 다운로드 쿠폰 정보 조회
|
||||
export const getProductCouponInfo = (props) => (dispatch, getState) => {
|
||||
|
||||
@@ -20,7 +20,7 @@ import css from './UserReviewPanel.module.less';
|
||||
|
||||
// 디버그 헬퍼 설정
|
||||
const DEBUG_MODE = false;
|
||||
const { dlog, dwarn, derror } = createDebugHelpers(DEBUG_MODE);
|
||||
const { dlog, dwarn, derror /* eslint-disable-line no-unused-vars */ } = createDebugHelpers(DEBUG_MODE);
|
||||
|
||||
// 버전에 따른 UI 설정
|
||||
const VERSION_LABEL = REVIEW_VERSION === 1 ? '[v1 - 기존 API]' : '[v2 - 신 API]';
|
||||
@@ -41,8 +41,8 @@ const UserReviewPanel = ({ className, panelInfo, spotlightId }) => {
|
||||
userReviewPanelTotalPages,
|
||||
goToNextUserReviewPage,
|
||||
goToPrevUserReviewPage,
|
||||
applyRatingFilter,
|
||||
applySentimentFilter,
|
||||
applyRatingFilter, // eslint-disable-line no-unused-vars
|
||||
applySentimentFilter, // eslint-disable-line no-unused-vars
|
||||
clearAllFilters,
|
||||
currentFilter,
|
||||
filterCounts,
|
||||
@@ -50,10 +50,10 @@ const UserReviewPanel = ({ className, panelInfo, spotlightId }) => {
|
||||
_debug,
|
||||
// 🎯 API 기반 필터링 데이터
|
||||
filters,
|
||||
filteredReviewListData,
|
||||
filteredReviewListData, // eslint-disable-line no-unused-vars
|
||||
currentReviewFilter,
|
||||
// 전체 리뷰 데이터 (팝업용)
|
||||
allReviews,
|
||||
allReviews, // eslint-disable-line no-unused-vars
|
||||
filteredReviews, // ✅ 필터링된 전체 리뷰 (팝업에서 사용)
|
||||
getReviewsWithImages,
|
||||
extractImagesFromReviews,
|
||||
@@ -226,7 +226,15 @@ const UserReviewPanel = ({ className, panelInfo, spotlightId }) => {
|
||||
return sentimentMap;
|
||||
}, [filters]);
|
||||
|
||||
// API 기반 별점 필터 핸들러
|
||||
const getApiKeywordClickHandler = useCallback(
|
||||
(keywordValue) => () => handleApiKeywordsFilter(keywordValue),
|
||||
[handleApiKeywordsFilter]
|
||||
);
|
||||
|
||||
const getApiSentimentClickHandler = useCallback(
|
||||
(sentimentValue) => () => handleApiSentimentFilter(sentimentValue),
|
||||
[handleApiSentimentFilter]
|
||||
);
|
||||
const handleApiRatingFilter = useCallback(
|
||||
(rating) => {
|
||||
if (!prdtId || !patnrId) {
|
||||
@@ -621,7 +629,7 @@ const UserReviewPanel = ({ className, panelInfo, spotlightId }) => {
|
||||
<FilterItemButton
|
||||
key={keyword.filterTpVal}
|
||||
text={`${keyword.filterNm} (${keyword.filterNmCnt})`}
|
||||
onClick={() => handleApiKeywordsFilter(keyword.filterTpVal)}
|
||||
onClick={getApiKeywordClickHandler(keyword.filterTpVal)}
|
||||
spotlightId={`filter-keyword-${index}`}
|
||||
ariaLabel={`Filter by ${keyword.filterNm} keyword`}
|
||||
dataSpotlightUp={
|
||||
@@ -693,7 +701,7 @@ const UserReviewPanel = ({ className, panelInfo, spotlightId }) => {
|
||||
<FilterItemButton
|
||||
key={sentiment}
|
||||
text={`${sentiment.charAt(0).toUpperCase() + sentiment.slice(1)} (${count})`}
|
||||
onClick={() => handleApiSentimentFilter(sentiment)}
|
||||
onClick={getApiSentimentClickHandler(sentiment)}
|
||||
spotlightId={`filter-sentiment-${sentiment}`}
|
||||
ariaLabel={`Filter by ${sentiment} sentiment`}
|
||||
dataSpotlightUp={
|
||||
|
||||
Reference in New Issue
Block a user