Skip to content

Commit

Permalink
front: drop unnecessary errors check in editor error list modal
Browse files Browse the repository at this point in the history
errors is always set to a non-null array.
  • Loading branch information
emersion committed Jun 24, 2024
1 parent af12495 commit a3c40fd
Showing 1 changed file with 21 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -158,29 +158,27 @@ const InfraErrorsList: React.FC<InfraErrorsListProps> = ({ infraID, onErrorClick
scrollableTarget="errors-list-container"
next={() => fetch(infraID, next ?? 1, filterLevel, filterType ?? undefined)}
>
{errors && (
<ul className="list-group">
{errors.map((item, index) => (
<li key={uniqueId()} className="list-group-item management-item">
<InfraErrorBox error={item} index={index + 1}>
{EDITOAST_TYPES.includes(item.obj_type as EditoastType) && (
<button
className="dropdown-item"
type="button"
aria-label={t('Editor.infra-errors.list.goto-error')}
title={t('Editor.infra-errors.list.goto-error')}
onClick={() => {
onErrorClick(infraID, item);
}}
>
<FaDiamondTurnRight size={30} />
</button>
)}
</InfraErrorBox>
</li>
))}
</ul>
)}
<ul className="list-group">
{errors.map((item, index) => (
<li key={uniqueId()} className="list-group-item management-item">
<InfraErrorBox error={item} index={index + 1}>
{EDITOAST_TYPES.includes(item.obj_type as EditoastType) && (
<button
className="dropdown-item"
type="button"
aria-label={t('Editor.infra-errors.list.goto-error')}
title={t('Editor.infra-errors.list.goto-error')}
onClick={() => {
onErrorClick(infraID, item);
}}
>
<FaDiamondTurnRight size={30} />
</button>
)}
</InfraErrorBox>
</li>
))}
</ul>
</InfiniteScroll>
</div>
</div>
Expand Down

0 comments on commit a3c40fd

Please sign in to comment.