[251123] fix: CategoryPanel webOS용 재시도 및 가드로직 추가

🕐 커밋 시간: 2025. 11. 23. 22:14:06

📊 변경 통계:
  • 총 파일: 3개
  • 추가: +44줄
  • 삭제: -17줄

📝 수정된 파일:
  ~ com.twin.app.shoptime/src/actions/mainActions.js
  ~ com.twin.app.shoptime/src/components/TabLayout/TabLayout.jsx
  ~ com.twin.app.shoptime/src/views/CategoryPanel/CategoryPanel.jsx

🔧 함수 변경 내용:
  📄 com.twin.app.shoptime/src/actions/mainActions.js (javascript):
    🔄 Modified: getMainCategoryShowDetail(), getTop20Show()

🔧 주요 변경 내용:
  • 핵심 비즈니스 로직 개선
  • UI 컴포넌트 아키텍처 개선
This commit is contained in:
2025-11-23 22:14:06 +09:00
parent 549f5caee7
commit 3b95810946
3 changed files with 188 additions and 292 deletions

View File

@@ -152,8 +152,10 @@ export const getMainCategoryShowDetail = (props) => (dispatch, getState) => {
// 서브카테고리 조회 IF-LGSP-051
let getSubCategoryKey = null;
let lastSubCategoryParams = {};
const SUB_CATEGORY_RETRY_LIMIT = 3;
const SUB_CATEGORY_RETRY_DELAY_MS = 400;
export const getSubCategory =
(params, pageNo = 1, key = null, clear = false) =>
(params, pageNo = 1, key = null, clear = false, retryCount = 0) =>
(dispatch, getState) => {
const { lgCatCd, patnrIdList, tabType, filterType, recommendIncFlag } = params;
let pageSize = params.pageSize || CATEGORY_DATA_MAX_RESULTS_LIMIT;
@@ -214,6 +216,22 @@ export const getSubCategory =
};
const onFail = (error) => {
const nextRetryCount = retryCount + 1;
const canRetry = nextRetryCount < SUB_CATEGORY_RETRY_LIMIT;
if (canRetry) {
console.warn('getSubCategory retry', {
lgCatCd,
pageNo,
retryCount: nextRetryCount,
});
setTimeout(() => {
dispatch(getSubCategory(params, pageNo, currentKey, clear, nextRetryCount));
}, SUB_CATEGORY_RETRY_DELAY_MS * nextRetryCount);
return;
}
console.error('getSubCategory onFail', error);
if (pageNo === 1) {
lastSubCategoryParams = {};
@@ -234,23 +252,23 @@ export const getSubCategory =
export const continueGetSubCategory = (key, pageNo) => (dispatch, getState) => {
if (!lastSubCategoryParams) {
// <<<<<<< HEAD
// <<<<<<< HEAD
console.warn('No previous category parameters found');
// =======
// console.warn("No previous category parameters found");
// >>>>>>> gitlab/develop
// =======
// console.warn("No previous category parameters found");
// >>>>>>> gitlab/develop
return;
}
const subCategoryData = getState().main.subCategoryData;
const targetData =
// <<<<<<< HEAD
// <<<<<<< HEAD
subCategoryData[key]?.subCatItemList || subCategoryData[key]?.subCatShowList || [];
// =======
// subCategoryData[key]?.subCatItemList ||
// subCategoryData[key]?.subCatShowList ||
// [];
// >>>>>>> gitlab/develop
// =======
// subCategoryData[key]?.subCatItemList ||
// subCategoryData[key]?.subCatShowList ||
// [];
// >>>>>>> gitlab/develop
const totalCount = subCategoryData[key]?.total ?? 0;
const startIndex = CATEGORY_DATA_MAX_RESULTS_LIMIT * (pageNo - 1);
if (
@@ -261,13 +279,13 @@ export const continueGetSubCategory = (key, pageNo) => (dispatch, getState) => {
//ignore query
return;
}
// <<<<<<< HEAD
// <<<<<<< HEAD
dispatch(getSubCategory({ ...lastSubCategoryParams }, pageNo, getSubCategoryKey));
// =======
// dispatch(
// getSubCategory({ ...lastSubCategoryParams }, pageNo, getSubCategoryKey)
// );
// >>>>>>> gitlab/develop
// =======
// dispatch(
// getSubCategory({ ...lastSubCategoryParams }, pageNo, getSubCategoryKey)
// );
// >>>>>>> gitlab/develop
};
const clearSubCategory = () => ({
@@ -341,11 +359,11 @@ export const getMainYouMayLike =
getState,
'get',
URLS.GET_YOUMAYLIKE,
// <<<<<<< HEAD
// <<<<<<< HEAD
{ lgCatCd, exclCurationId, exclPatnrId, exclPrdtId, catDpTh3, catDpTh4 },
// =======
// { lgCatCd, catDpTh3, catDpTh4, exclCurationId, exclPatnrId, exclPrdtId },
// >>>>>>> gitlab/develop
// =======
// { lgCatCd, catDpTh3, catDpTh4, exclCurationId, exclPatnrId, exclPrdtId },
// >>>>>>> gitlab/develop
{},
onSuccess,
onFail