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

Merge pull request #863 from porter-dev/0.6.0-frontend-new-project-bugfixes

[0.6.0] [Frontend] Bugfixes for provisioner not showing up and project deletion
abelanger5 4 лет назад
Родитель
Сommit
6befe75bb1
2 измененных файлов с 3 добавлено и 4 удалено
  1. 0 3
      dashboard/src/main/home/Home.tsx
  2. 3 1
      dashboard/src/shared/Context.tsx

+ 0 - 3
dashboard/src/main/home/Home.tsx

@@ -90,9 +90,6 @@ class Home extends Component<PropsType, StateType> {
   };
 
   getCapabilities = () => {
-    let { currentProject } = this.props;
-    if (!currentProject) return;
-
     api
       .getCapabilities("<token>", {}, {})
       .then((res) => {

+ 3 - 1
dashboard/src/shared/Context.tsx

@@ -86,9 +86,11 @@ class ContextProvider extends Component<PropsType, StateType> {
     },
     currentProject: null,
     setCurrentProject: (currentProject: ProjectType, callback?: any) => {
-      pushQueryParams(this.props, { project_id: currentProject.id.toString() });
       if (currentProject) {
         localStorage.setItem("currentProject", currentProject.id.toString());
+        pushQueryParams(this.props, {
+          project_id: currentProject.id.toString(),
+        });
       } else {
         localStorage.removeItem("currentProject");
       }