[251013] chore(config): [251013] appinfo.webos.json 추가
🕐 커밋 시간: 2025. 10. 13. 18:31:49 📊 변경 통계: • 총 파일: 2개 • 추가: +53줄 • 삭제: -6줄 📁 추가된 파일: + com.twin.app.shoptime/webos-meta/appinfo.webos.json 📝 수정된 파일: ~ com.twin.app.shoptime/src/hooks/useReviews/useReviews.js 🔧 주요 변경 내용: • 핵심 비즈니스 로직 개선 • 소규모 기능 개선
This commit is contained in:
@@ -232,8 +232,40 @@ const useReviews = (prdtId, patnrId) => {
|
||||
};
|
||||
}
|
||||
|
||||
// 별점이 없는 리뷰들 찾기
|
||||
const noStarReviews = allReviews.filter((review) => {
|
||||
const rating = review.rvwScr || review.rvwRtng || review.rating;
|
||||
return !rating || rating === 0;
|
||||
});
|
||||
|
||||
// 별점이 없는 리뷰들 로그 출력
|
||||
if (noStarReviews.length > 0) {
|
||||
console.log('[UserReviews]-NoStar 별점 없는 리뷰들:', {
|
||||
totalReviews: allReviews.length,
|
||||
noStarCount: noStarReviews.length,
|
||||
noStarReviews: noStarReviews.map((review) => ({
|
||||
rvwId: review.rvwId,
|
||||
rvwScr: review.rvwScr,
|
||||
rvwRtng: review.rvwRtng,
|
||||
rating: review.rating,
|
||||
rvwCtnt: review.rvwCtnt?.substring(0, 50) + '...',
|
||||
wrtrNknm: review.wrtrNknm,
|
||||
})),
|
||||
});
|
||||
}
|
||||
|
||||
// 별점이 있는 리뷰만 카운트 (1~5점)
|
||||
let ratingSum = 0;
|
||||
for (let i = 1; i <= 5; i++) {
|
||||
const count = allReviews.filter((review) => {
|
||||
const rating = review.rvwScr || review.rvwRtng || review.rating || 0;
|
||||
return Math.round(rating) === i;
|
||||
}).length;
|
||||
ratingSum += count;
|
||||
}
|
||||
|
||||
const counts = {
|
||||
rating: { all: allReviews.length },
|
||||
rating: { all: ratingSum }, // 별점이 있는 리뷰만 카운트
|
||||
keyword: {},
|
||||
sentiment: {},
|
||||
};
|
||||
@@ -290,7 +322,11 @@ const useReviews = (prdtId, patnrId) => {
|
||||
switch (currentFilter.type) {
|
||||
case 'rating':
|
||||
if (currentFilter.value === 'all' || currentFilter.value === null) {
|
||||
result = [...allReviews]; // 전체 표시
|
||||
// 'all' 필터: 별점이 있는 리뷰만 표시 (별점 없는 리뷰 제외)
|
||||
result = allReviews.filter((review) => {
|
||||
const rating = review.rvwScr || review.rvwRtng || review.rating;
|
||||
return rating && rating > 0;
|
||||
});
|
||||
} else {
|
||||
result = allReviews.filter((review) => {
|
||||
const rating = review.rvwScr || review.rvwRtng || review.rating || 0;
|
||||
@@ -498,9 +534,21 @@ const useReviews = (prdtId, patnrId) => {
|
||||
|
||||
// 통계 정보
|
||||
const stats = useMemo(() => {
|
||||
// API와 실제 리뷰 개수 불일치 확인
|
||||
const apiTotalCount = reviewDetail && reviewDetail.totRvwCnt ? reviewDetail.totRvwCnt : 0;
|
||||
const actualReviewCount = allReviews.length;
|
||||
|
||||
if (apiTotalCount > actualReviewCount && actualReviewCount > 0) {
|
||||
console.log('[UserReviews]-API Mismatch API 개수와 실제 개수 불일치:', {
|
||||
apiTotalCount,
|
||||
actualReviewCount,
|
||||
difference: apiTotalCount - actualReviewCount,
|
||||
reason: 'API가 최대 100개만 반환하는 페이징 제한',
|
||||
});
|
||||
}
|
||||
|
||||
return {
|
||||
totalReviews:
|
||||
reviewDetail && reviewDetail.totRvwCnt ? reviewDetail.totRvwCnt : allReviews.length, // 전체 리뷰 개수
|
||||
totalReviews: actualReviewCount, // 실제로 받은 리뷰 개수 사용 (API 제한 반영)
|
||||
filteredCount: filteredReviews.length, // 필터링된 리뷰 개수
|
||||
displayedCount: displayReviews.length, // 현재 표시 중인 리뷰 개수
|
||||
averageRating:
|
||||
@@ -509,8 +557,7 @@ const useReviews = (prdtId, patnrId) => {
|
||||
: reviewDetail && reviewDetail.avgRvwScr
|
||||
? reviewDetail.avgRvwScr
|
||||
: 0,
|
||||
totalRatingCount:
|
||||
reviewDetail && reviewDetail.totRvwCnt ? reviewDetail.totRvwCnt : allReviews.length,
|
||||
totalRatingCount: actualReviewCount, // 실제로 받은 리뷰 개수 사용
|
||||
};
|
||||
}, [allReviews.length, filteredReviews.length, displayReviews.length, reviewDetail]);
|
||||
|
||||
|
||||
29
com.twin.app.shoptime/webos-meta/appinfo.webos.json
Normal file
29
com.twin.app.shoptime/webos-meta/appinfo.webos.json
Normal file
@@ -0,0 +1,29 @@
|
||||
{
|
||||
"id": "com.twin.voiceapp",
|
||||
"version": "1.0",
|
||||
"vendor": "T-Win",
|
||||
"type": "web",
|
||||
"main": "index.html",
|
||||
"title": "Voice Auto App",
|
||||
"icon": "icon.png",
|
||||
"largeIcon": "largeIcon.png",
|
||||
"handlesRelaunch": true,
|
||||
"requiredPermissions": [
|
||||
"time.query",
|
||||
"device.info",
|
||||
"applications.query",
|
||||
"settings.read",
|
||||
"applications.operation"
|
||||
],
|
||||
"inAppVoiceIntent": {
|
||||
"contentTarget": {
|
||||
"intent": "$INTENT",
|
||||
"intentParam": "$INTENT_PARAM",
|
||||
"languageCode": "$LANG_CODE"
|
||||
},
|
||||
"voiceConfig": {
|
||||
"supportedIntent": ["UseIME", "SearchContent"],
|
||||
"supportedVoiceLanguage": ["ko-KR", "en-US"]
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user