diff --git a/src/Components/CreateImageWizard/steps/Review/ReviewStepTables.tsx b/src/Components/CreateImageWizard/steps/Review/ReviewStepTables.tsx index d7211413..431cc9ff 100644 --- a/src/Components/CreateImageWizard/steps/Review/ReviewStepTables.tsx +++ b/src/Components/CreateImageWizard/steps/Review/ReviewStepTables.tsx @@ -159,10 +159,12 @@ export const SnapshotTable = ({ .padStart(2, '0')}/${date.getFullYear()}`; }; - return ( - (isError && ) || - (isLoading && ) || - (isSuccess && ( + if (isError) return ; + + if (isLoading) return ; + + if (isSuccess) { + return ( @@ -200,8 +202,8 @@ export const SnapshotTable = ({
- )) - ); + ); + } }; export const PackagesTable = () => { diff --git a/src/Components/CreateImageWizard/steps/Review/ReviewStepTextLists.tsx b/src/Components/CreateImageWizard/steps/Review/ReviewStepTextLists.tsx index a7720778..3665f3c7 100644 --- a/src/Components/CreateImageWizard/steps/Review/ReviewStepTextLists.tsx +++ b/src/Components/CreateImageWizard/steps/Review/ReviewStepTextLists.tsx @@ -448,7 +448,7 @@ export const ContentList = () => { [customRepositories, recommendedRepositories], ); - const [listSnapshotsByDate, { data, isSuccess, isLoading, isError }] = + const [listSnapshotsByDate, { data, isSuccess, isLoading }] = useListSnapshotsByDateMutation(); useEffect(() => { @@ -536,8 +536,7 @@ export const ContentList = () => { isInline aria-label='Snapshot method' className='popover-button pf-v6-u-p-0' - isDisabled={noRepositoriesSelected || isLoading || isError} - isLoading={isLoading} + isDisabled={noRepositoriesSelected} > {snapshottingText} @@ -558,7 +557,7 @@ export const ContentList = () => { Custom repositories - {customRepositories?.length + recommendedRepositories.length > 0 ? ( + {customRepositories.length + recommendedRepositories.length > 0 ? ( { aria-label='About custom repositories' className='popover-button pf-v6-u-p-0' > - {customRepositories?.length + - recommendedRepositories.length || 0} + {customRepositories.length + recommendedRepositories.length || + 0} ) : ( @@ -583,7 +582,7 @@ export const ContentList = () => { Additional packages - {packages?.length > 0 || groups?.length > 0 ? ( + {packages.length > 0 || groups.length > 0 ? ( { aria-label='About packages' className='popover-button pf-v6-u-p-0' > - {packages?.length + groups?.length} + {packages.length + groups.length} ) : ( @@ -671,7 +670,7 @@ export const RegisterNowList = () => { data-testid='review-registration' > - {registrationType?.startsWith('register-now') && ( + {registrationType.startsWith('register-now') && ( Register with Red Hat Subscription Manager (RHSM)