Fixed a bug in the LogArea.jsx

This commit is contained in:
Mathias Wagner 2023-06-02 00:40:46 +02:00
parent 1f089f08b7
commit 288f33d693
Signed by: Mathias
GPG Key ID: B8DC354B0A1F5B44

View File

@ -10,12 +10,14 @@ export const LogArea = ({steps, completedSteps, failedStep}) => (
</div>
<div className="log-items">
{steps.map((step) => {
{steps.map((step, index) => {
const stepBefore = index > 0 ? steps[index - 1] : {step: -1};
return <div className={"log-item" + (completedSteps.includes(step.step) ? " icon-success" : "")
+ (failedStep === step.step ? " icon-failed" : "")}
id={step.step} key={step.step}>
{failedStep === step.step ? <FontAwesomeIcon icon={faWarning}/>
: (!completedSteps.includes(step.step) && completedSteps.includes(step.step - 1))
: (!completedSteps.includes(step.step) && completedSteps.includes(stepBefore.step))
? <FontAwesomeIcon icon={faCircleNotch} spin={true} className="icon-small"/>
: <FontAwesomeIcon icon={faCheck}/>}