Procházet zdrojové kódy

Merge pull request #1134 from porter-dev/staging

Staging
jusrhee před 4 roky
rodič
revize
48989fb5b0

+ 4 - 5
dashboard/src/main/home/cluster-dashboard/expanded-chart/ExpandedChart.tsx

@@ -378,14 +378,13 @@ const ExpandedChart: React.FC<Props> = (props) => {
                   <Spinner src={loadingSrc} /> This application is currently
                   being deployed
                 </Header>
-                Navigate to the
-                <A
-                  href={`https://github.com/${props.currentChart.git_action_config.git_repo}/actions`}
+                Navigate to the <A
+                  href={props.currentChart.git_action_config && `https://github.com/${props.currentChart.git_action_config?.git_repo}/actions`}
                   target={"_blank"}
                 >
-                  Actions tab
+                  Actions
                 </A>{" "}
-                of your GitHub repo to view live build logs.
+                tab of your GitHub repo to view live build logs.
               </TextWrap>
             </Placeholder>
           );

+ 5 - 5
server/api/oauth_github_handler.go

@@ -133,11 +133,6 @@ func (app *App) HandleGithubOAuthCallback(w http.ResponseWriter, r *http.Request
 		// send to segment
 		app.AnalyticsClient.Identify(analytics.CreateSegmentIdentifyUser(user))
 
-		app.AnalyticsClient.Track(analytics.UserCreateTrack(&analytics.UserCreateTrackOpts{
-			UserScopedTrackOpts: analytics.GetUserScopedTrackOpts(user.ID),
-			Email:               user.Email,
-		}))
-
 		// log the user in
 		app.Logger.Info().Msgf("New user created: %d", user.ID)
 
@@ -236,6 +231,11 @@ func (app *App) upsertUserFromToken(tok *oauth2.Token) (*models.User, error) {
 				return nil, err
 			}
 
+			app.AnalyticsClient.Track(analytics.UserCreateTrack(&analytics.UserCreateTrackOpts{
+				UserScopedTrackOpts: analytics.GetUserScopedTrackOpts(user.ID),
+				Email:               user.Email,
+			}))
+
 			if !verified {
 				// non-fatal email verification flow
 				app.startEmailVerificationFlow(user)