견적서 상세화면 새로고침 대응
This commit is contained in:
parent
e49bb7f4e6
commit
0724279e20
@ -6,7 +6,7 @@ import { estimateState, floorPlanObjectState } from '@/store/floorPlanObjectAtom
|
||||
import { isObjectNotEmpty, isEmptyArray } from '@/util/common-utils'
|
||||
import { SessionContext } from '@/app/SessionProvider'
|
||||
import { useMessage } from '@/hooks/useMessage'
|
||||
import { useRouter } from 'next/navigation'
|
||||
import { useRouter, useSearchParams } from 'next/navigation'
|
||||
import { FloorPlanContext } from '@/app/floor-plan/FloorPlanProvider'
|
||||
import { QcastContext } from '@/app/QcastProvider'
|
||||
import { useSwal } from '@/hooks/useSwal'
|
||||
@ -35,11 +35,14 @@ export const useEstimateController = (planNo) => {
|
||||
|
||||
const [isLoading, setIsLoading] = useState(false)
|
||||
const { estimateContextState, setEstimateContextState } = useContext(FloorPlanContext)
|
||||
|
||||
const searchParams = useSearchParams()
|
||||
useEffect(() => {
|
||||
if (planNo && !isLoading) {
|
||||
if (objectRecoil.floorPlanObjectNo && planNo) {
|
||||
fetchSetting(objectRecoil.floorPlanObjectNo, planNo)
|
||||
//견적서 화면에서 새로고침시 리코일 사라지는 현상 대응
|
||||
let recoilObjectNo = objectRecoil.floorPlanObjectNo ? objectRecoil.floorPlanObjectNo : searchParams.get('objectNo')
|
||||
|
||||
if (recoilObjectNo && planNo) {
|
||||
fetchSetting(recoilObjectNo, planNo)
|
||||
}
|
||||
}
|
||||
}, [])
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user