Просмотр исходного кода

Merge branch 'nico/new-onboarding-flow' of https://github.com/porter-dev/porter into nico/new-onboarding-flow

jusrhee 4 лет назад
Родитель
Сommit
98f5214903
1 измененных файлов с 7 добавлено и 2 удалено
  1. 7 2
      dashboard/src/main/home/Home.tsx

+ 7 - 2
dashboard/src/main/home/Home.tsx

@@ -200,7 +200,7 @@ class Home extends Component<PropsType, StateType> {
     this.getMetadata();
 
     if (
-      !this.context.hasFinishedOnboarding && 
+      !this.context.hasFinishedOnboarding &&
       this.props.history.location.pathname &&
       !this.props.history.location.pathname.includes("onboarding")
     ) {
@@ -230,6 +230,11 @@ class Home extends Component<PropsType, StateType> {
       const project_id = this.context?.currentProject?.id;
       const res = await api.getOnboardingState("<token>", {}, { project_id });
 
+      if (res.status === 404) {
+        this.context.setHasFinishedOnboarding(true);
+        return;
+      }
+
       if (res?.data && res?.data.current_step !== "clean_up") {
         this.context.setHasFinishedOnboarding(false);
       } else {
@@ -244,7 +249,7 @@ class Home extends Component<PropsType, StateType> {
   // 3. Make sure initializing from URL (DO oauth) displays the appropriate initial view
   componentDidUpdate(prevProps: PropsType) {
     if (
-      !this.context.hasFinishedOnboarding && 
+      !this.context.hasFinishedOnboarding &&
       prevProps.match.url !== this.props.match.url &&
       this.props.history.location.pathname &&
       !this.props.history.location.pathname.includes("onboarding") &&