[검색시 로그관련 주석처리] 추후 수정을 위한 주석처리
This commit is contained in:
@@ -1,23 +1,51 @@
|
||||
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
||||
import React, {
|
||||
useCallback,
|
||||
useEffect,
|
||||
useMemo,
|
||||
useRef,
|
||||
useState,
|
||||
} from 'react';
|
||||
|
||||
import { useDispatch, useSelector } from 'react-redux';
|
||||
import {
|
||||
useDispatch,
|
||||
useSelector,
|
||||
} from 'react-redux';
|
||||
|
||||
import { Job } from '@enact/core/util';
|
||||
import Spotlight from '@enact/spotlight';
|
||||
import SpotlightContainerDecorator from '@enact/spotlight/SpotlightContainerDecorator';
|
||||
import SpotlightContainerDecorator
|
||||
from '@enact/spotlight/SpotlightContainerDecorator';
|
||||
import { setContainerLastFocusedElement } from '@enact/spotlight/src/container';
|
||||
|
||||
import { sendLogGNB, sendLogTotalRecommend } from '../../actions/logActions';
|
||||
import {
|
||||
sendLogGNB,
|
||||
sendLogTotalRecommend,
|
||||
} from '../../actions/logActions';
|
||||
import { getMyRecommandedKeyword } from '../../actions/myPageActions';
|
||||
import { popPanel, updatePanel } from '../../actions/panelActions';
|
||||
import { getSearch, resetSearch } from '../../actions/searchActions';
|
||||
import {
|
||||
popPanel,
|
||||
updatePanel,
|
||||
} from '../../actions/panelActions';
|
||||
import {
|
||||
getSearch,
|
||||
resetSearch,
|
||||
} from '../../actions/searchActions';
|
||||
import TBody from '../../components/TBody/TBody';
|
||||
import TInput, { ICONS, KINDS } from '../../components/TInput/TInput';
|
||||
import TInput, {
|
||||
ICONS,
|
||||
KINDS,
|
||||
} from '../../components/TInput/TInput';
|
||||
import TPanel from '../../components/TPanel/TPanel';
|
||||
import TVerticalPagenator from '../../components/TVerticalPagenator/TVerticalPagenator';
|
||||
import TVerticalPagenator
|
||||
from '../../components/TVerticalPagenator/TVerticalPagenator';
|
||||
import usePrevious from '../../hooks/usePrevious';
|
||||
import useSearchVoice from '../../hooks/useSearchVoice';
|
||||
import { LOG_CONTEXT_NAME, LOG_MENU, LOG_MESSAGE_ID, panel_names } from '../../utils/Config';
|
||||
import {
|
||||
LOG_CONTEXT_NAME,
|
||||
LOG_MENU,
|
||||
LOG_MESSAGE_ID,
|
||||
panel_names,
|
||||
} from '../../utils/Config';
|
||||
import { SpotlightIds } from '../../utils/SpotlightIds';
|
||||
import NoSearchResults from './NoSearchResults/NoSearchResults';
|
||||
import RecommendedKeywords from './RecommendedKeywords/RecommendedKeywords';
|
||||
@@ -108,23 +136,23 @@ export default function SearchPanel({ panelInfo, isOnTop, spotlightId }) {
|
||||
}
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
const result = Object.values(searchDatas).reduce((acc, curr) => {
|
||||
return acc + curr.length;
|
||||
}, 0);
|
||||
// useEffect(() => {
|
||||
// const result = Object.values(searchDatas).reduce((acc, curr) => {
|
||||
// return acc + curr.length;
|
||||
// }, 0);
|
||||
|
||||
if (searchQuery) {
|
||||
dispatch(
|
||||
sendLogTotalRecommend({
|
||||
query: searchQuery,
|
||||
searchType: searchPerformed ? 'query' : 'keyword',
|
||||
result: result,
|
||||
contextName: LOG_CONTEXT_NAME.SEARCH,
|
||||
messageId: LOG_MESSAGE_ID.SEARCH_ITEM,
|
||||
})
|
||||
);
|
||||
}
|
||||
}, [searchDatas, searchPerformed, dispatch, handleSearchSubmit]);
|
||||
// if (searchQuery) {
|
||||
// dispatch(
|
||||
// sendLogTotalRecommend({
|
||||
// query: searchQuery,
|
||||
// searchType: searchPerformed ? 'query' : 'keyword',
|
||||
// result: result,
|
||||
// contextName: LOG_CONTEXT_NAME.SEARCH,
|
||||
// messageId: LOG_MESSAGE_ID.SEARCH_ITEM,
|
||||
// })
|
||||
// );
|
||||
// }
|
||||
// }, [searchDatas, searchPerformed, dispatch, handleSearchSubmit]);
|
||||
|
||||
const handleSearchSubmit = useCallback(
|
||||
(query) => {
|
||||
|
||||
@@ -681,34 +681,35 @@ export default function SearchPanel({ panelInfo, isOnTop, spotlightId }) {
|
||||
/**
|
||||
* LOG 용도,
|
||||
* 검색 시 로그를 보내는 용도의 이펙트
|
||||
* 주석처리
|
||||
*/
|
||||
useEffect(() => {
|
||||
const result = Object.values(searchDatas).reduce((acc, curr) => {
|
||||
return acc + curr.length;
|
||||
}, 0);
|
||||
// useEffect(() => {
|
||||
// const result = Object.values(searchDatas).reduce((acc, curr) => {
|
||||
// return acc + curr.length;
|
||||
// }, 0);
|
||||
|
||||
if (searchQuery) {
|
||||
dispatch(
|
||||
sendLogTotalRecommend({
|
||||
query: searchQuery,
|
||||
searchType: searchPerformed ? "query" : "keyword",
|
||||
result: result,
|
||||
contextName: LOG_CONTEXT_NAME.SEARCH,
|
||||
messageId: LOG_MESSAGE_ID.SEARCH_ITEM,
|
||||
})
|
||||
);
|
||||
// if (searchQuery) {
|
||||
// dispatch(
|
||||
// sendLogTotalRecommend({
|
||||
// query: searchQuery,
|
||||
// searchType: searchPerformed ? "query" : "keyword",
|
||||
// result: result,
|
||||
// contextName: LOG_CONTEXT_NAME.SEARCH,
|
||||
// messageId: LOG_MESSAGE_ID.SEARCH_ITEM,
|
||||
// })
|
||||
// );
|
||||
|
||||
// 검색 완료 후 결과에 따른 Toast 표시
|
||||
// if (searchPerformed && searchQuery.trim()) {
|
||||
// if (result > 0) {
|
||||
// dispatch(showSearchSuccessToast(searchQuery, result));
|
||||
// } else {
|
||||
// dispatch(showSearchErrorToast(searchQuery));
|
||||
// }
|
||||
// }
|
||||
}
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [searchDatas, searchPerformed, searchQuery]);
|
||||
// // 검색 완료 후 결과에 따른 Toast 표시
|
||||
// // if (searchPerformed && searchQuery.trim()) {
|
||||
// // if (result > 0) {
|
||||
// // dispatch(showSearchSuccessToast(searchQuery, result));
|
||||
// // } else {
|
||||
// // dispatch(showSearchErrorToast(searchQuery));
|
||||
// // }
|
||||
// // }
|
||||
// }
|
||||
// // eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
// }, [searchDatas, searchPerformed, searchQuery]);
|
||||
|
||||
/**
|
||||
* clean up 용도
|
||||
|
||||
@@ -1705,34 +1705,35 @@ export default function SearchPanel({ panelInfo, isOnTop, spotlightId }) {
|
||||
/**
|
||||
* LOG 용도,
|
||||
* 검색 시 로그를 보내는 용도의 이펙트
|
||||
* 우선 주석처리 (계속보내는부분에 대한 처리 필요)
|
||||
*/
|
||||
useEffect(() => {
|
||||
const result = Object.values(searchDatas).reduce((acc, curr) => {
|
||||
return acc + curr.length;
|
||||
}, 0);
|
||||
// useEffect(() => {
|
||||
// const result = Object.values(searchDatas).reduce((acc, curr) => {
|
||||
// return acc + curr.length;
|
||||
// }, 0);
|
||||
|
||||
if (searchQuery) {
|
||||
dispatch(
|
||||
sendLogTotalRecommend({
|
||||
query: searchQuery,
|
||||
searchType: searchPerformed ? 'query' : 'keyword',
|
||||
result: result,
|
||||
contextName: LOG_CONTEXT_NAME.SEARCH,
|
||||
messageId: LOG_MESSAGE_ID.SEARCH_ITEM,
|
||||
})
|
||||
);
|
||||
// if (searchQuery) {
|
||||
// dispatch(
|
||||
// sendLogTotalRecommend({
|
||||
// query: searchQuery,
|
||||
// searchType: searchPerformed ? 'query' : 'keyword',
|
||||
// result: result,
|
||||
// contextName: LOG_CONTEXT_NAME.SEARCH,
|
||||
// messageId: LOG_MESSAGE_ID.SEARCH_ITEM,
|
||||
// })
|
||||
// );
|
||||
|
||||
// 검색 완료 후 결과에 따른 Toast 표시
|
||||
// if (searchPerformed && searchQuery.trim()) {
|
||||
// if (result > 0) {
|
||||
// dispatch(showSearchSuccessToast(searchQuery, result));
|
||||
// } else {
|
||||
// dispatch(showSearchErrorToast(searchQuery));
|
||||
// }
|
||||
// }
|
||||
}
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [searchDatas, searchPerformed, searchQuery]);
|
||||
// // 검색 완료 후 결과에 따른 Toast 표시
|
||||
// // if (searchPerformed && searchQuery.trim()) {
|
||||
// // if (result > 0) {
|
||||
// // dispatch(showSearchSuccessToast(searchQuery, result));
|
||||
// // } else {
|
||||
// // dispatch(showSearchErrorToast(searchQuery));
|
||||
// // }
|
||||
// // }
|
||||
// }
|
||||
// // eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
// }, [searchDatas, searchPerformed, searchQuery]);
|
||||
|
||||
/**
|
||||
* clean up 용도
|
||||
|
||||
Reference in New Issue
Block a user