fix: gridInfo 미정의 오류 수정

- 문제: updateComponentProperty 함수 내에서 정의되지 않은 gridInfo 변수 참조
- 해결: gridInfo 조건을 prevLayout.gridSettings 체크로 변경
- 영향: 컴포넌트 속성 업데이트 시 런타임 오류 해결
This commit is contained in:
kjs 2025-11-10 15:42:35 +09:00
parent cdf9c0e562
commit 5f11b5083f
1 changed files with 2 additions and 3 deletions

View File

@ -515,8 +515,8 @@ export default function ScreenDesigner({ selectedScreen, onBackToList }: ScreenD
current[finalKey] = value;
// gridColumns 변경 시 크기 자동 업데이트
if (path === "gridColumns" && gridInfo) {
const updatedSize = updateSizeFromGridColumns(newComp, layout.gridSettings as GridUtilSettings);
if (path === "gridColumns" && prevLayout.gridSettings) {
const updatedSize = updateSizeFromGridColumns(newComp, prevLayout.gridSettings as GridUtilSettings);
newComp.size = updatedSize;
}
@ -524,7 +524,6 @@ export default function ScreenDesigner({ selectedScreen, onBackToList }: ScreenD
if (
(path === "size.width" || path === "size.height") &&
prevLayout.gridSettings?.snapToGrid &&
gridInfo &&
newComp.type !== "group"
) {
// 현재 해상도에 맞는 격자 정보로 스냅 적용