jnfrati 4 лет назад
Родитель
Сommit
485429c216

+ 15 - 11
dashboard/src/components/repo-selector/RepoList.tsx

@@ -136,25 +136,29 @@ const RepoList: React.FC<Props> = ({
           <Loading />
         </LoadingWrapper>
       );
-    } else if (repoError || accessError) {
+    } else if (repoError) {
       return <LoadingWrapper>Error loading repos.</LoadingWrapper>;
     } else if (repos.length == 0) {
-      return accessData.has_access ? (
+      if (accessError) {
+        return (
+          <LoadingWrapper>
+            No connected Github repos found.
+            <A href={"/api/integrations/github-app/oauth"}>
+              Authorize Porter to view your repositories.
+            </A>
+          </LoadingWrapper>
+        );
+      }
+
+      if (accessData.accounts?.length === 0) {
         <LoadingWrapper>
           No connected Github repos found. You can
           <A href={"/api/integrations/github-app/install"}>
             Install Porter in more repositories
           </A>
           .
-        </LoadingWrapper>
-      ) : (
-        <LoadingWrapper>
-          No connected Github repos found.
-          <A href={"/api/integrations/github-app/oauth"}>
-            Authorize Porter to view your repositories.
-          </A>
-        </LoadingWrapper>
-      );
+        </LoadingWrapper>;
+      }
     }
 
     // show 10 most recently used repos if user hasn't searched anything yet

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

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

+ 12 - 10
dashboard/src/main/home/modals/AccountSettingsModal.tsx

@@ -67,8 +67,19 @@ const AccountSettingsModal = () => {
         </LoadingWrapper>
       ) : (
         <>
+          {accessError && (
+            <ListWrapper>
+              <Helper>
+                No connected repositories found.
+                <A href={"/api/integrations/github-app/oauth"}>
+                  Authorize Porter to view your repositories.
+                </A>
+              </Helper>
+            </ListWrapper>
+          )}
+
           {/* Will be styled (and show what account is connected) later */}
-          {accessData.accounts?.length > 0 ? (
+          {!accessError && accessData.accounts?.length >= 0 && (
             <Placeholder>
               <User>
                 You are currently authorized as <B>{accessData.username}</B> and
@@ -107,15 +118,6 @@ const AccountSettingsModal = () => {
                 </>
               )}
             </Placeholder>
-          ) : (
-            <ListWrapper>
-              <Helper>
-                No connected repositories found.
-                <A href={"/api/integrations/github-app/oauth"}>
-                  Authorize Porter to view your repositories.
-                </A>
-              </Helper>
-            </ListWrapper>
           )}
         </>
       )}