瀏覽代碼

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 2 年之前
父節點
當前提交
7be6f9dbe3
共有 1 個文件被更改,包括 8 次插入5 次删除
  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() {
   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 (
     return (
       <Wrapper
       <Wrapper
         open={this.props.open}
         open={this.props.open}