정보검색 팝업 초기 코드 로딩 및 최초 조회 보완
This commit is contained in:
@@ -17,32 +17,15 @@ export default function SearchModalPopupContent() {
|
||||
} = useStore();
|
||||
|
||||
useEffect(() => {
|
||||
// Popup windows do not run map-layout initialization, so load search codes here.
|
||||
if (ctpv.length === 0) {
|
||||
void fetchCtpv();
|
||||
}
|
||||
// Popup windows do not run map-layout initialization, so load location codes here.
|
||||
if (ctpv.length === 0) void fetchCtpv();
|
||||
if (sgg.length === 0) void fetchSgg();
|
||||
}, [ctpv.length, fetchCtpv, fetchSgg, sgg.length]);
|
||||
|
||||
if (sgg.length === 0) {
|
||||
void fetchSgg();
|
||||
}
|
||||
useEffect(() => {
|
||||
if (BIZ_SE_CD.length === 0) void fetchBIZ_SE_CD();
|
||||
if (BIZ_TY_CD.length === 0) void fetchBIZ_TY_CD();
|
||||
}, [BIZ_SE_CD.length, BIZ_TY_CD.length, fetchBIZ_SE_CD, fetchBIZ_TY_CD]);
|
||||
|
||||
if (BIZ_SE_CD.length === 0) {
|
||||
void fetchBIZ_SE_CD();
|
||||
}
|
||||
|
||||
if (BIZ_TY_CD.length === 0) {
|
||||
void fetchBIZ_TY_CD();
|
||||
}
|
||||
}, [
|
||||
BIZ_SE_CD.length,
|
||||
BIZ_TY_CD.length,
|
||||
ctpv.length,
|
||||
fetchBIZ_SE_CD,
|
||||
fetchBIZ_TY_CD,
|
||||
fetchCtpv,
|
||||
fetchSgg,
|
||||
sgg.length,
|
||||
]);
|
||||
|
||||
return <SearchModal renderMode="popup" />;
|
||||
return <SearchModal renderMode="popup" autoSearchReady={ctpv.length > 0 && sgg.length > 0} />;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user