Prechádzať zdrojové kódy

Merge pull request #439 from smiclea/fix-sync-issues

Fix sync issues when going from details to list
Dorin Paslaru 6 rokov pred
rodič
commit
43c35713df
2 zmenil súbory, kde vykonal 8 pridanie a 2 odobranie
  1. 4 1
      src/stores/MigrationStore.js
  2. 4 1
      src/stores/ReplicaStore.js

+ 4 - 1
src/stores/MigrationStore.js

@@ -84,7 +84,10 @@ class MigrationStore {
 
 
     try {
     try {
       let migration = await MigrationSource.getMigration(migrationId, options && options.skipLog)
       let migration = await MigrationSource.getMigration(migrationId, options && options.skipLog)
-      runInAction(() => { this.migrationDetails = migration })
+      runInAction(() => {
+        this.migrationDetails = migration
+        this.migrations = this.migrations.map(m => m.id === migration.id ? migration : m)
+      })
     } finally {
     } finally {
       runInAction(() => { this.detailsLoading = false })
       runInAction(() => { this.detailsLoading = false })
     }
     }

+ 4 - 1
src/stores/ReplicaStore.js

@@ -105,7 +105,10 @@ class ReplicaStore {
 
 
     try {
     try {
       let replica = await ReplicaSource.getReplica(replicaId, options && options.skipLog)
       let replica = await ReplicaSource.getReplica(replicaId, options && options.skipLog)
-      runInAction(() => { this.replicaDetails = replica })
+      runInAction(() => {
+        this.replicaDetails = replica
+        this.replicas = this.replicas.map(r => r.id === replica.id ? replica : r)
+      })
     } finally {
     } finally {
       runInAction(() => { this.detailsLoading = false })
       runInAction(() => { this.detailsLoading = false })
     }
     }