물건 도면작성 버튼 컨트롤
This commit is contained in:
parent
81d04ff25a
commit
6c6ba0eb72
@ -23,7 +23,7 @@ export default function StuffSubHeader({ type }) {
|
||||
|
||||
const setFloorPlanObjectNo = useSetRecoilState(floorPlanObjectState)
|
||||
|
||||
const { managementState } = useContext(GlobalDataContext)
|
||||
const { managementState, setManagementState } = useContext(GlobalDataContext)
|
||||
|
||||
const [buttonStyle, setButtonStyle] = useState('')
|
||||
|
||||
@ -31,17 +31,20 @@ export default function StuffSubHeader({ type }) {
|
||||
|
||||
useEffect(() => {
|
||||
window.scrollTo(0, 0)
|
||||
setManagementState({})
|
||||
}, [])
|
||||
|
||||
useEffect(() => {
|
||||
if (isObjectNotEmpty(managementState)) {
|
||||
if (managementState?.createSaleStoreId === 'T01') {
|
||||
if (session?.storeId !== 'T01') {
|
||||
setButtonStyle('none')
|
||||
if (type === 'detail') {
|
||||
if (isObjectNotEmpty(managementState)) {
|
||||
if (managementState?.createSaleStoreId === 'T01') {
|
||||
if (session?.storeId !== 'T01') {
|
||||
setButtonStyle('none')
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}, [managementState?.createSaleStoreId])
|
||||
}, [type, managementState])
|
||||
|
||||
const searchParams = useSearchParams()
|
||||
const objectNo = searchParams.get('objectNo') //url에서 물건번호 꺼내서 바로 set
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user