2
0
Эх сурвалжийг харах

Merge pull request #831 from porter-dev/0.5.0-fix-829-hello-porter-image-set

[0.5.0] [bugfix] Update chart uses old chart config instead of new one
abelanger5 4 жил өмнө
parent
commit
3d0b4f263e

+ 10 - 4
dashboard/src/main/home/cluster-dashboard/expanded-chart/ExpandedChart.tsx

@@ -112,10 +112,10 @@ export default class ExpandedChart extends Component<PropsType, StateType> {
           !this.state.newestImage
           !this.state.newestImage
         ) {
         ) {
           imageIsPlaceholder = true;
           imageIsPlaceholder = true;
-        } 
+        }
         this.updateComponents(
         this.updateComponents(
-          { 
-            currentChart: res.data, 
+          {
+            currentChart: res.data,
             loading: false,
             loading: false,
             imageIsPlaceholder,
             imageIsPlaceholder,
             newestImage,
             newestImage,
@@ -260,6 +260,11 @@ export default class ExpandedChart extends Component<PropsType, StateType> {
       values = this.props.currentChart.config;
       values = this.props.currentChart.config;
     }
     }
 
 
+    // Override config from currentChart prop if we have it on the current state
+    if (this.state.currentChart.config) {
+      values = this.state.currentChart.config;
+    }
+
     for (let key in rawValues) {
     for (let key in rawValues) {
       _.set(values, key, rawValues[key]);
       _.set(values, key, rawValues[key]);
     }
     }
@@ -397,7 +402,8 @@ export default class ExpandedChart extends Component<PropsType, StateType> {
             <Placeholder>
             <Placeholder>
               <TextWrap>
               <TextWrap>
                 <Header>
                 <Header>
-                  <Spinner src={loading} /> This application is currently being deployed
+                  <Spinner src={loading} /> This application is currently being
+                  deployed
                 </Header>
                 </Header>
                 Navigate to the "Actions" tab of your GitHub repo to view live
                 Navigate to the "Actions" tab of your GitHub repo to view live
                 build logs.
                 build logs.