[251020] fix: VoiceInputOverlay searchId Reset Resolved
🕐 커밋 시간: 2025. 10. 20. 23:26:04 📊 변경 통계: • 총 파일: 5개 • 추가: +28줄 • 삭제: -3줄 📝 수정된 파일: ~ com.twin.app.shoptime/.gitignore ~ com.twin.app.shoptime/src/actions/actionTypes.js ~ com.twin.app.shoptime/src/actions/searchActions.js ~ com.twin.app.shoptime/src/reducers/searchReducer.js ~ com.twin.app.shoptime/src/views/SearchPanel/SearchPanel.new.jsx 🔧 함수 변경 내용: 📄 com.twin.app.shoptime/src/actions/searchActions.js (javascript): ✅ Added: resetSearch() 🔧 주요 변경 내용: • 타입 시스템 안정성 강화 • 핵심 비즈니스 로직 개선
This commit is contained in:
1
com.twin.app.shoptime/.gitignore
vendored
1
com.twin.app.shoptime/.gitignore
vendored
@@ -15,3 +15,4 @@ npm-debug.log
|
|||||||
# ipk file
|
# ipk file
|
||||||
srcBackup
|
srcBackup
|
||||||
# com.lgshop.app_*.ipk
|
# com.lgshop.app_*.ipk
|
||||||
|
.docs
|
||||||
|
|||||||
@@ -171,6 +171,7 @@ export const types = {
|
|||||||
GET_SHOPPERHOUSE_SEARCH: 'GET_SHOPPERHOUSE_SEARCH',
|
GET_SHOPPERHOUSE_SEARCH: 'GET_SHOPPERHOUSE_SEARCH',
|
||||||
CLEAR_SHOPPERHOUSE_DATA: 'CLEAR_SHOPPERHOUSE_DATA',
|
CLEAR_SHOPPERHOUSE_DATA: 'CLEAR_SHOPPERHOUSE_DATA',
|
||||||
RESET_SEARCH: 'RESET_SEARCH',
|
RESET_SEARCH: 'RESET_SEARCH',
|
||||||
|
RESET_VOICE_SEARCH: 'RESET_VOICE_SEARCH',
|
||||||
GET_SEARCH_PROCESSED: 'GET_SEARCH_PROCESSED',
|
GET_SEARCH_PROCESSED: 'GET_SEARCH_PROCESSED',
|
||||||
SET_SEARCH_INIT_PERFORMED: 'SET_SEARCH_INIT_PERFORMED',
|
SET_SEARCH_INIT_PERFORMED: 'SET_SEARCH_INIT_PERFORMED',
|
||||||
UPDATE_SEARCH_TIMESTAMP: 'UPDATE_SEARCH_TIMESTAMP',
|
UPDATE_SEARCH_TIMESTAMP: 'UPDATE_SEARCH_TIMESTAMP',
|
||||||
|
|||||||
@@ -77,6 +77,11 @@ export const resetSearch = (status) => {
|
|||||||
return { type: types.RESET_SEARCH, payload: status };
|
return { type: types.RESET_SEARCH, payload: status };
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const resetVoiceSearch = () => {
|
||||||
|
getShopperHouseSearchKey = null;
|
||||||
|
return { type: types.RESET_VOICE_SEARCH };
|
||||||
|
};
|
||||||
|
|
||||||
export const setInitPerformed = (performed) => ({
|
export const setInitPerformed = (performed) => ({
|
||||||
type: types.SET_SEARCH_INIT_PERFORMED,
|
type: types.SET_SEARCH_INIT_PERFORMED,
|
||||||
payload: performed,
|
payload: performed,
|
||||||
|
|||||||
@@ -44,7 +44,20 @@ export const searchReducer = (state = initialState, action) => {
|
|||||||
|
|
||||||
case types.RESET_SEARCH:
|
case types.RESET_SEARCH:
|
||||||
return {
|
return {
|
||||||
...initialState,
|
...state,
|
||||||
|
searchDatas: {},
|
||||||
|
totalCount: {},
|
||||||
|
searchPerformed: false,
|
||||||
|
initPerformed: false,
|
||||||
|
searchTimestamp: null,
|
||||||
|
// shopperHouseData, shopperHouseSearchId 유지
|
||||||
|
};
|
||||||
|
|
||||||
|
case types.RESET_VOICE_SEARCH:
|
||||||
|
return {
|
||||||
|
...state,
|
||||||
|
shopperHouseData: null,
|
||||||
|
shopperHouseSearchId: null,
|
||||||
};
|
};
|
||||||
|
|
||||||
case types.SET_SEARCH_INIT_PERFORMED:
|
case types.SET_SEARCH_INIT_PERFORMED:
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ import hotPicksBrandImage from '../../../assets/images/searchpanel/img-search-ho
|
|||||||
import { sendLogGNB, sendLogTotalRecommend } from '../../actions/logActions';
|
import { sendLogGNB, sendLogTotalRecommend } from '../../actions/logActions';
|
||||||
import { getMyRecommandedKeyword } from '../../actions/myPageActions';
|
import { getMyRecommandedKeyword } from '../../actions/myPageActions';
|
||||||
import { popPanel, updatePanel } from '../../actions/panelActions';
|
import { popPanel, updatePanel } from '../../actions/panelActions';
|
||||||
import { getSearch, resetSearch } from '../../actions/searchActions';
|
import { getSearch, resetSearch, resetVoiceSearch } from '../../actions/searchActions';
|
||||||
// import {
|
// import {
|
||||||
// showErrorToast,
|
// showErrorToast,
|
||||||
// showInfoToast,
|
// showInfoToast,
|
||||||
@@ -216,6 +216,11 @@ export default function SearchPanel({ panelInfo, isOnTop, spotlightId }) {
|
|||||||
}
|
}
|
||||||
}, [dispatch, searchQuery]);
|
}, [dispatch, searchQuery]);
|
||||||
|
|
||||||
|
// 컴포넌트 마운트 시 Voice Search 상태 초기화
|
||||||
|
useEffect(() => {
|
||||||
|
dispatch(resetVoiceSearch());
|
||||||
|
}, [dispatch]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (recommandedKeywords) {
|
if (recommandedKeywords) {
|
||||||
const startIndex = (currentPage - 1) * ITEMS_PER_PAGE;
|
const startIndex = (currentPage - 1) * ITEMS_PER_PAGE;
|
||||||
@@ -425,7 +430,10 @@ export default function SearchPanel({ panelInfo, isOnTop, spotlightId }) {
|
|||||||
if (!isOnTopRef.current) {
|
if (!isOnTopRef.current) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
console.log('🖱️ [DEBUG][SearchPanel] onClickMic called, current isVoiceOverlayVisible:', isVoiceOverlayVisible);
|
console.log(
|
||||||
|
'🖱️ [DEBUG][SearchPanel] onClickMic called, current isVoiceOverlayVisible:',
|
||||||
|
isVoiceOverlayVisible
|
||||||
|
);
|
||||||
setIsVoiceOverlayVisible(true);
|
setIsVoiceOverlayVisible(true);
|
||||||
// setIsVoiceOverlayVisible((prev) => !prev);
|
// setIsVoiceOverlayVisible((prev) => !prev);
|
||||||
}, [isOnTopRef, isVoiceOverlayVisible]);
|
}, [isOnTopRef, isVoiceOverlayVisible]);
|
||||||
@@ -522,7 +530,9 @@ export default function SearchPanel({ panelInfo, isOnTop, spotlightId }) {
|
|||||||
|
|
||||||
// Voice overlay close handler
|
// Voice overlay close handler
|
||||||
const handleVoiceOverlayClose = useCallback(() => {
|
const handleVoiceOverlayClose = useCallback(() => {
|
||||||
console.log('🚪 [DEBUG][SearchPanel] handleVoiceOverlayClose called, setting isVoiceOverlayVisible to FALSE');
|
console.log(
|
||||||
|
'🚪 [DEBUG][SearchPanel] handleVoiceOverlayClose called, setting isVoiceOverlayVisible to FALSE'
|
||||||
|
);
|
||||||
setIsVoiceOverlayVisible(false);
|
setIsVoiceOverlayVisible(false);
|
||||||
|
|
||||||
// ✅ VoiceOverlay가 닫힐 때 항상 TInput으로 포커스 이동
|
// ✅ VoiceOverlay가 닫힐 때 항상 TInput으로 포커스 이동
|
||||||
|
|||||||
Reference in New Issue
Block a user