Skip to content

Commit

Permalink
Clean code and change dashboard render conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
jbiset committed Dec 15, 2023
1 parent a43b514 commit dab1335
Showing 1 changed file with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ const DashboardVulsComponent: React.FC = () => {
<>
<I18nProvider>
<>
<h1>{resultIndexData?.hits?.total}</h1>
{isLoading || isLoadingSearchbar ? <LoadingSpinner /> : null}
{!isLoading && !isLoadingSearchbar ? (
<SearchBar
Expand All @@ -63,16 +62,13 @@ const DashboardVulsComponent: React.FC = () => {
) : null}
{!isLoadingSearchbar &&
!isLoading &&
(isError ||
!resultIndexData?.hits?.total ||
resultIndexData?.hits?.total === 0) ? (
(isError || resultIndexData?.hits?.total === 0) ? (
<DiscoverNoResults message={error?.message} />
) : null}
{!isLoadingSearchbar &&
!isLoading &&
isSuccess &&
resultIndexData?.hits?.total &&
resultIndexData?.hits?.total > 0 ? (
resultIndexData?.hits?.total !== 0 ? (
<>
<div className='vulnerability-dashboard-filters-wrapper'>
<DashboardByRenderer
Expand Down

0 comments on commit dab1335

Please sign in to comment.