forked from ddrilling/asb_cloud_front
Исправлен баг с неизменением значения WellTreeSelector при переходе по страницам
This commit is contained in:
parent
da382ba9c8
commit
278ebeb573
@ -61,7 +61,6 @@ export const WellTreeSelector = () => {
|
|||||||
const history = useHistory()
|
const history = useHistory()
|
||||||
const routeMatch = useRouteMatch('/:route/:id')
|
const routeMatch = useRouteMatch('/:route/:id')
|
||||||
|
|
||||||
/* eslint-disable react-hooks/exhaustive-deps */
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
invokeWebApiWrapperAsync(
|
invokeWebApiWrapperAsync(
|
||||||
async () => {
|
async () => {
|
||||||
@ -87,13 +86,16 @@ export const WellTreeSelector = () => {
|
|||||||
})),
|
})),
|
||||||
}))
|
}))
|
||||||
setWellsTree(wellsTree)
|
setWellsTree(wellsTree)
|
||||||
setValue(getLabel(wellsTree, routeMatch?.url))
|
|
||||||
},
|
},
|
||||||
setShowLoader,
|
setShowLoader,
|
||||||
`Не удалось загрузить список скважин`
|
`Не удалось загрузить список скважин`
|
||||||
)
|
)
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
setValue(getLabel(wellsTree, routeMatch?.url))
|
||||||
|
}, [wellsTree, routeMatch])
|
||||||
|
|
||||||
const onChange = (value: string): void => {
|
const onChange = (value: string): void => {
|
||||||
if (wellsTree)
|
if (wellsTree)
|
||||||
setValue(getLabel(wellsTree, value))
|
setValue(getLabel(wellsTree, value))
|
||||||
|
Loading…
Reference in New Issue
Block a user