Kaynağa Gözat

Fix conditional on branch list

jnfrati 4 yıl önce
ebeveyn
işleme
a86f6dd7a7

+ 4 - 1
dashboard/src/components/repo-selector/BranchList.tsx

@@ -24,8 +24,11 @@ const BranchList: React.FC<Props> = ({ setBranch, actionConfig }) => {
 
 
   useEffect(() => {
   useEffect(() => {
     // Get branches
     // Get branches
+    if (!actionConfig) {
+      return () => {};
+    }
 
 
-    if (actionConfig.git_repo_id !== 0) {
+    if (actionConfig?.kind === "github") {
       api
       api
         .getBranches(
         .getBranches(
           "<token>",
           "<token>",