fix: remove last non-existing step app icon

This commit is contained in:
Ali BARIN
2022-08-07 00:22:44 +02:00
parent c5bb07a768
commit 03cfa8b904

View File

@@ -12,10 +12,9 @@ export default function FlowAppIcons(props: FlowAppIconsProps) {
const { steps } = props;
const stepsCount = steps.length;
const firstStep = steps[0];
const lastStep = steps[stepsCount - 1];
const lastStep = steps.length > 1 && steps[stepsCount - 1];
const intermeaditeStepCount = stepsCount - 2;
return (
<>
<AppIcon
@@ -27,11 +26,11 @@ export default function FlowAppIcons(props: FlowAppIconsProps) {
{intermeaditeStepCount > 0 && <IntermediateStepCount count={intermeaditeStepCount} />}
<AppIcon
{lastStep && <AppIcon
name=" "
variant="rounded"
url={lastStep.iconUrl}
/>
/>}
</>
)
};