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

Fix: detect endpoint recurrent calls.

Fixed an issue where the detect endpoint was being called almost constantly,
which lead the user to not being able to update their build config.
jnfrati пре 4 година
родитељ
комит
945ef5c278

+ 3 - 3
dashboard/src/main/home/cluster-dashboard/expanded-chart/BuildSettingsTab.tsx

@@ -231,7 +231,7 @@ const BuildSettingsTab: React.FC<Props> = ({ chart, isPreviousVersion }) => {
     }
   };
 
-  const getActionConfig = () => {
+  const currentActionConfig = useMemo(() => {
     const actionConf = chart.git_action_config;
     if (actionConf && actionConf.gitlab_integration_id) {
       return {
@@ -244,7 +244,7 @@ const BuildSettingsTab: React.FC<Props> = ({ chart, isPreviousVersion }) => {
       kind: "github",
       ...actionConf,
     } as FullActionConfigType;
-  };
+  }, [chart]);
 
   return (
     <Wrapper>
@@ -301,7 +301,7 @@ const BuildSettingsTab: React.FC<Props> = ({ chart, isPreviousVersion }) => {
             <Heading>Buildpack Settings</Heading>
             <BuildpackConfigSection
               currentChart={chart}
-              actionConfig={getActionConfig()}
+              actionConfig={currentActionConfig}
               onChange={(buildConfig) => setBuildConfig(buildConfig)}
             />
           </>