Преглед изворни кода

Fix deleted execution reappearing in the executions timeline

Signed-off-by: Mihaela Balutoiu <mbalutoiu@cloudbasesolutions.com>
Mihaela Balutoiu пре 2 недеља
родитељ
комит
3af72b3de8
1 измењених фајлова са 6 додато и 0 уклоњено
  1. 6 0
      src/stores/TransferStore.ts

+ 6 - 0
src/stores/TransferStore.ts

@@ -92,6 +92,8 @@ class TransferStore {
 
   executionsPageSize = 10;
 
+  private deletedExecutionIds: Set<string> = new Set();
+
   @action resetTransferPagination(): void {
     this.transfersPage = 1;
     this.transfersHasNextPage = false;
@@ -288,6 +290,7 @@ class TransferStore {
           const incoming = transfer.executions.filter(
             e =>
               e.number > newestNumber &&
+              !this.deletedExecutionIds.has(e.id) &&
               !this.executionsList.find(l => l.id === e.id),
           );
           if (incoming.length > 0) {
@@ -300,6 +303,7 @@ class TransferStore {
           const withTasks = exec as ExecutionTasks;
           if (
             Array.isArray(withTasks.tasks) &&
+            !this.deletedExecutionIds.has(exec.id) &&
             !this.executionsTasks.find(et => et.id === exec.id)
           ) {
             sortTasks(withTasks.tasks, TransferSourceUtils.sortTaskUpdates);
@@ -318,6 +322,7 @@ class TransferStore {
     this.transferDetails = null;
     this.currentlyLoadingExecution = "";
     this.executionsTasks = [];
+    this.deletedExecutionIds.clear();
   }
 
   @action getTransfersSuccess(
@@ -462,6 +467,7 @@ class TransferStore {
   }
 
   @action deleteExecutionSuccess(transferId: string, executionId: string) {
+    this.deletedExecutionIds.add(executionId);
     let executions = [];
 
     if (this.transferDetails?.id === transferId) {