Anukul Sangwan 4 سال پیش
والد
کامیت
f7d144c3f6

+ 1 - 1
dashboard/src/main/home/launch/launch-flow/LaunchFlow.tsx

@@ -241,7 +241,7 @@ const LaunchFlow: React.FC<PropsType> = (props) => {
     }
 
     let githubActionConfig: FullActionConfigType = null;
-    if (sourceType == "repo") {
+    if (sourceType === "repo") {
       githubActionConfig = getFullActionConfig();
     }
 

+ 11 - 15
dashboard/src/main/home/launch/launch-flow/SettingsPage.tsx

@@ -192,21 +192,17 @@ class SettingsPage extends Component<PropsType, StateType> {
     } = this.props;
 
     if (hasSource) {
-      if (sourceType === "repo") {
-        return (
-          <BackButton width="155px" onClick={() => setPage("workflow")}>
-            <i className="material-icons">first_page</i>
-            GitHub Actions
-          </BackButton>
-        );
-      } else if (sourceType === "registry") {
-        return (
-          <BackButton width="155px" onClick={() => setPage("source")}>
-            <i className="material-icons">first_page</i>
-            Source Settings
-          </BackButton>
-        );
-      }
+      const [pageKey, pageName] =
+        sourceType === "repo"
+          ? ["workflow", "GitHub Actions"]
+          : ["source", "Source Settings"];
+
+      return (
+        <BackButton width="155px" onClick={() => setPage(pageKey)}>
+          <i className="material-icons">first_page</i>
+          {pageName}
+        </BackButton>
+      );
     }
 
     return (

+ 2 - 2
dashboard/src/main/home/launch/launch-flow/SourcePage.tsx

@@ -230,9 +230,9 @@ class SourcePage extends Component<PropsType, StateType> {
   handleContinue = () => {
     const { sourceType, setPage } = this.props;
 
-    if (sourceType == "repo") {
+    if (sourceType === "repo") {
       setPage("workflow");
-    } else if (sourceType == "registry") {
+    } else {
       setPage("settings");
     }
   };