Преглед на файлове

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
променени са 1 файла, в които са добавени 3 реда и са изтрити 3 реда
  1. 3 3
      dashboard/src/main/home/cluster-dashboard/expanded-chart/BuildSettingsTab.tsx

+ 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)}
             />
           </>