dev #68
@ -76,8 +76,12 @@ export default function CanvasFrame() {
|
||||
}
|
||||
initEvent()
|
||||
})
|
||||
} else {
|
||||
setSelectedMenu(null)
|
||||
}
|
||||
Object.keys(currentCanvasPlan).length > 0 && canvas && handleModuleSelectionTotal()
|
||||
} else {
|
||||
setSelectedMenu(null)
|
||||
}
|
||||
gridInit()
|
||||
}
|
||||
|
||||
@ -3,9 +3,17 @@
|
||||
import { useContext, useEffect, useState } from 'react'
|
||||
import { usePathname, useRouter } from 'next/navigation'
|
||||
|
||||
import { useRecoilState, useResetRecoilState } from 'recoil'
|
||||
import { useRecoilState, useResetRecoilState, useSetRecoilState } from 'recoil'
|
||||
|
||||
import { canvasState, currentCanvasPlanState, plansState, canvasSettingState, currentObjectState, moduleSetupSurfaceState } from '@/store/canvasAtom'
|
||||
import {
|
||||
canvasState,
|
||||
currentCanvasPlanState,
|
||||
plansState,
|
||||
canvasSettingState,
|
||||
currentObjectState,
|
||||
moduleSetupSurfaceState,
|
||||
currentMenuState,
|
||||
} from '@/store/canvasAtom'
|
||||
import { useAxios } from '@/hooks/useAxios'
|
||||
import { useMessage } from '@/hooks/useMessage'
|
||||
import { useSwal } from '@/hooks/useSwal'
|
||||
@ -33,7 +41,7 @@ export function usePlan(params = {}) {
|
||||
const { floorPlanState } = useContext(FloorPlanContext)
|
||||
|
||||
const [selectedPlan, setSelectedPlan] = useState(null)
|
||||
|
||||
const setCurrentMenu = useSetRecoilState(currentMenuState)
|
||||
const [canvas, setCanvas] = useRecoilState(canvasState)
|
||||
|
||||
const [currentCanvasPlan, setCurrentCanvasPlan] = useRecoilState(currentCanvasPlanState)
|
||||
@ -577,8 +585,10 @@ export function usePlan(params = {}) {
|
||||
* plan canvasStatus 초기화
|
||||
*/
|
||||
const resetCanvasStatus = () => {
|
||||
setCurrentCanvasPlan((prev) => ({ ...prev, canvasStatus: null }))
|
||||
setCurrentCanvasPlan((prev) => ({ ...prev, canvasStatus: null, objectNo: null, planNo: null, id: null }))
|
||||
setPlans((plans) => plans.map((plan) => ({ ...plan, canvasStatus: null })))
|
||||
setCurrentMenu(null)
|
||||
setSelectedMenu(null)
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user