Merge pull request #1888 from siiky/fix/lam-1456/reload-machine-name-on-change
LAM-1456 fix: reload machine name on change
This commit is contained in:
commit
50eb0a0933
1 changed files with 4 additions and 12 deletions
|
|
@ -59,7 +59,7 @@ const GET_INFO = gql`
|
||||||
`
|
`
|
||||||
|
|
||||||
const MachineRoute = () => {
|
const MachineRoute = () => {
|
||||||
const [location, navigate] = useLocation()
|
const [, navigate] = useLocation()
|
||||||
const [loading, setLoading] = useState(true)
|
const [loading, setLoading] = useState(true)
|
||||||
const { id: deviceId } = useParams()
|
const { id: deviceId } = useParams()
|
||||||
|
|
||||||
|
|
@ -78,18 +78,10 @@ const MachineRoute = () => {
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
const reload = () => {
|
return !loading && <Machines data={data} refetch={refetch}></Machines>
|
||||||
return navigate(location)
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
|
||||||
!loading && (
|
|
||||||
<Machines data={data} refetch={refetch} reload={reload}></Machines>
|
|
||||||
)
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const Machines = ({ data, refetch, reload }) => {
|
const Machines = ({ data, refetch }) => {
|
||||||
const timezone = R.path(['config', 'locale_timezone'], data) ?? {}
|
const timezone = R.path(['config', 'locale_timezone'], data) ?? {}
|
||||||
|
|
||||||
const machine = R.path(['machine'])(data) ?? {}
|
const machine = R.path(['machine'])(data) ?? {}
|
||||||
|
|
@ -112,7 +104,7 @@ const Machines = ({ data, refetch, reload }) => {
|
||||||
{machineName}
|
{machineName}
|
||||||
</TL2>
|
</TL2>
|
||||||
</Breadcrumbs>
|
</Breadcrumbs>
|
||||||
<Overview data={machine} onActionSuccess={reload} />
|
<Overview data={machine} onActionSuccess={refetch} />
|
||||||
</div>
|
</div>
|
||||||
<div className="basis-3/4 max-w-3/4 flex flex-col mt-6">
|
<div className="basis-3/4 max-w-3/4 flex flex-col mt-6">
|
||||||
<div>
|
<div>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue