Alexander Belanger 5 лет назад
Родитель
Сommit
fdcf8d296a
1 измененных файлов с 9 добавлено и 0 удалено
  1. 9 0
      dashboard/src/main/home/provisioner/Provisioner.tsx

+ 9 - 0
dashboard/src/main/home/provisioner/Provisioner.tsx

@@ -53,21 +53,30 @@ class Provisioner extends Component<PropsType, StateType> {
     // Check that an infra that was previously in a non-created state, and
     // which was a cluster, is now in a created state. If so, propagate update
     // so that cluster can be refreshed.
+    console.log("called component did update", prevProps, prevState)
+
     let prevInfraStates: Record<number, string> = {};
 
     prevState.infras.forEach((infra, i) => {
       prevInfraStates[infra.id] = infra.status;
     });
 
+    console.log("got previous infra states", prevInfraStates)
+
     this.state.infras.forEach((infra, i) => {
+      console.log("testing current infra", infra, prevInfraStates[infra.id], infra.status == "created", prevInfraStates[infra.id] != "created")
+
       if (
         prevInfraStates[infra.id] &&
         infra.status == "created" &&
         prevInfraStates[infra.id] != "created"
       ) {
+        console.log("triggered get clusters")
+
         api
           .getClusters("<token>", {}, { id: this.context.currentProject.id })
           .then(res => {
+            console.log("got the clusters", res.data)
             this.context.setCurrentCluster(res.data[0]);
           })
           .catch(err => {