|
|
@@ -35,6 +35,7 @@ type StateType = {
|
|
|
showWelcome: boolean,
|
|
|
currentView: string,
|
|
|
handleDO: boolean, // Trigger DO infra calls after oauth flow if needed
|
|
|
+ ghRedirect: boolean,
|
|
|
forceRefreshClusters: boolean, // For updating ClusterSection from modal on deletion
|
|
|
|
|
|
// Track last project id for refreshing clusters on project change
|
|
|
@@ -52,6 +53,7 @@ export default class Home extends Component<PropsType, StateType> {
|
|
|
forceRefreshClusters: false,
|
|
|
sidebarReady: false,
|
|
|
handleDO: false,
|
|
|
+ ghRedirect: false,
|
|
|
}
|
|
|
|
|
|
// TODO: Refactor and prevent flash + multiple reload
|
|
|
@@ -71,7 +73,11 @@ export default class Home extends Component<PropsType, StateType> {
|
|
|
this.setState({ currentView: 'provisioner', sidebarReady: true, });
|
|
|
} else {
|
|
|
// console.log('getting here', currentCluster)
|
|
|
- this.setState({ currentView: 'dashboard', sidebarReady: true });
|
|
|
+ if (this.state.ghRedirect) {
|
|
|
+ this.setState({ currentView: 'integrations', sidebarReady: true, ghRedirect: false });
|
|
|
+ } else {
|
|
|
+ this.setState({ currentView: 'dashboard', sidebarReady: true });
|
|
|
+ }
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
@@ -200,6 +206,9 @@ export default class Home extends Component<PropsType, StateType> {
|
|
|
this.setState({ handleDO: true });
|
|
|
this.checkDO();
|
|
|
}
|
|
|
+
|
|
|
+ this.setState({ ghRedirect: urlParams.get('gh_oauth') !== null });
|
|
|
+ urlParams.delete('gh_oauth');
|
|
|
|
|
|
let { user } = this.context;
|
|
|
window.location.href.indexOf('127.0.0.1') === -1 && posthog.init(process.env.POSTHOG_API_KEY, {
|