1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-27 10:50:10 +03:00

B #~: Add missing changes to files tab (#2463)

(cherry picked from commit dd9620f92e62ce21a48cf2c9e52b521cbdbb0dd4)
This commit is contained in:
Frederick Borges 2023-01-27 14:31:20 +01:00 committed by Tino Vázquez
parent 726a6a8547
commit 72b7753650
No known key found for this signature in database
GPG Key ID: 14201E424D02047E

View File

@ -32,7 +32,7 @@ const getTabComponent = (tabName) =>
const FileTabs = memo(({ id }) => {
const { view, getResourceView } = useViews()
const { isLoading, isError, error, status } = useGetImageQuery({ id })
const { isError, error, status, data } = useGetImageQuery({ id })
const tabsAvailable = useMemo(() => {
const resource = RESOURCE_NAMES.IMAGE
@ -48,14 +48,12 @@ const FileTabs = memo(({ id }) => {
</Alert>
)
}
if (isLoading || status === 'pending') {
return <LinearProgress color="secondary" sx={{ width: '100%' }} />
}
if (status === 'fulfilled') {
if (status === 'fulfilled' || id === data?.ID) {
return <Tabs addBorder tabs={tabsAvailable ?? []} />
}
return <></>
return <LinearProgress color="secondary" sx={{ width: '100%' }} />
})
FileTabs.propTypes = { id: PropTypes.string.isRequired }
FileTabs.displayName = 'FileTabs'