roofMaterials 로드 처리 삭제
This commit is contained in:
parent
05b7293cb9
commit
e688b54b12
@ -140,7 +140,6 @@ export function useCanvasSetting() {
|
||||
const selectedRoofMaterial = useRecoilValue(selectedRoofMaterialSelector) // 선택된 지붕재 정보
|
||||
const { floorPlanState } = useContext(FloorPlanContext) // 플랜 상태
|
||||
const { closeAll } = usePopup() // 팝업 닫기
|
||||
const [isRoofMaterialsLoaded, setIsRoofMaterialsLoaded] = useState(false) // roofMaterials 로드 상태 확인
|
||||
|
||||
useEffect(() => {
|
||||
const tempFetchRoofMaterials = !fetchRoofMaterials
|
||||
@ -152,15 +151,6 @@ export function useCanvasSetting() {
|
||||
}
|
||||
}, [])
|
||||
|
||||
/**
|
||||
* roofMaterials가 변경될 때마다 로드 상태 업데이트
|
||||
*/
|
||||
useEffect(() => {
|
||||
if (roofMaterials.length > 0) {
|
||||
setIsRoofMaterialsLoaded(true)
|
||||
}
|
||||
}, [roofMaterials])
|
||||
|
||||
/**
|
||||
* 지붕재 초기세팅
|
||||
*/
|
||||
@ -319,23 +309,6 @@ export function useCanvasSetting() {
|
||||
*/
|
||||
const fetchBasicSettings = async (planNo, openPoint) => {
|
||||
try {
|
||||
/* roofMaterials가 로드될 때까지 대기 후 실행 */
|
||||
if (!isRoofMaterialsLoaded) {
|
||||
/* roofMaterials가 아직 로드되지 않았다면 */
|
||||
await new Promise((resolve) => {
|
||||
/* 새로운 Promise 생성 */
|
||||
const checkInterval = setInterval(() => {
|
||||
/* 100ms마다 체크하는 인터벌 설정 */
|
||||
console.log('roofMaterials loading... ', roofMaterials.length)
|
||||
if (roofMaterials.length > 0) {
|
||||
/* roofMaterials가 로드되었다면 */
|
||||
clearInterval(checkInterval) // 인터벌 중지
|
||||
resolve() // Promise 완료
|
||||
}
|
||||
}, 100)
|
||||
})
|
||||
}
|
||||
|
||||
await get({
|
||||
url: `/api/canvas-management/canvas-basic-settings/by-object/${correntObjectNo}/${planNo}`,
|
||||
}).then((res) => {
|
||||
@ -942,6 +915,7 @@ export function useCanvasSetting() {
|
||||
setAdsorptionRange,
|
||||
fetchSettings,
|
||||
fetchBasicSettings,
|
||||
basicSettingCopySave,
|
||||
frontSettings,
|
||||
globalFont,
|
||||
setGlobalFont,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user