Parcourir la source

Fix WARNING status shown for non-completed tasks

The WARNING status should now only be shown if the task contains a
warning and is completed.
Sergiu Miclea il y a 2 ans
Parent
commit
7be6f9dbe3
1 fichiers modifiés avec 8 ajouts et 5 suppressions
  1. 8 5
      src/components/modules/TransferModule/TaskItem/TaskItem.tsx

+ 8 - 5
src/components/modules/TransferModule/TaskItem/TaskItem.tsx

@@ -453,11 +453,14 @@ class TaskItem extends React.Component<Props> {
   }
 
   render() {
-    const status = this.props.item.progress_updates.some(update =>
-      update.message.startsWith("WARNING")
-    )
-      ? "WARNING"
-      : this.props.item.status;
+    const itemStatus = this.props.item.status;
+    const status =
+      itemStatus === "COMPLETED" &&
+      this.props.item.progress_updates.some(update =>
+        update.message.startsWith("WARNING")
+      )
+        ? "WARNING"
+        : itemStatus;
     return (
       <Wrapper
         open={this.props.open}