Explorar el Código

fixed delete or register -> blank view

jusrhee hace 5 años
padre
commit
5e2f9e312a
Se han modificado 2 ficheros con 9 adiciones y 9 borrados
  1. 1 0
      dashboard/src/main/Login.tsx
  2. 8 9
      dashboard/src/main/home/Home.tsx

+ 1 - 0
dashboard/src/main/Login.tsx

@@ -58,6 +58,7 @@ export default class Login extends Component<PropsType, StateType> {
         if (err) {
           this.context.setCurrentError(err.response.data.errors[0])
         }
+        console.log(res)
         setUser(res?.data?.id, res?.data?.email)
         err ? console.log(err.response.data) : authenticate();
       });

+ 8 - 9
dashboard/src/main/home/Home.tsx

@@ -270,12 +270,6 @@ export default class Home extends Component<PropsType, StateType> {
         );
       } else if (currentView === 'integrations') {
         return <Integrations />;
-      } else if (currentView === 'new-project') {
-        return (
-          <NewProject 
-            setCurrentView={(x: string, data: any ) => this.setState({ currentView: x })} 
-          />
-        );
       } else if (currentView === 'provisioner') {
         return (
           <ProvisionerStatus
@@ -293,8 +287,12 @@ export default class Home extends Component<PropsType, StateType> {
           setCurrentView={(x: string) => this.setState({ currentView: x })}
         />
       );
-    } else {
-
+    } else if (currentView === 'new-project') {
+      return (
+        <NewProject 
+          setCurrentView={(x: string, data: any ) => this.setState({ currentView: x })} 
+        />
+      );
     }
   }
 
@@ -337,7 +335,8 @@ export default class Home extends Component<PropsType, StateType> {
         if (res.data.length > 0) {
           this.context.setCurrentProject(res.data[0]);
         } else {
-          this.context.currentModalData.setCurrentView('new-project');
+          this.context.setCurrentProject(null);
+          this.setState({ currentView: 'new-project' });
         }
         this.context.setCurrentModal(null, null);
       }