فهرست منبع

Merge branch 'sean-testing' of https://github.com/porter-dev/porter into beta.3.integration-frontend

jusrhee 5 سال پیش
والد
کامیت
3e09a0e2da
2فایلهای تغییر یافته به همراه3 افزوده شده و 5 حذف شده
  1. 3 4
      dashboard/src/main/home/sidebar/ClusterSection.tsx
  2. 0 1
      dashboard/src/shared/Context.tsx

+ 3 - 4
dashboard/src/main/home/sidebar/ClusterSection.tsx

@@ -53,12 +53,11 @@ export default class ClusterSection extends Component<PropsType, StateType> {
         // TODO: handle uninitialized kubeconfig
         if (res.data) {
           let clusters = res.data;
-          clusters.sort((a, b) => a.id - b.id);
+          clusters.sort((a: any, b: any) => a.id - b.id);
+          console.log(clusters);
           if (clusters.length > 0) {
             this.setState({ clusters });
-            setCurrentCluster(clusters[(
-              (localStorage.getItem('currentCluster')) ? localStorage.getItem('currentCluster') : 0
-            )]);
+            setCurrentCluster(clusters[0]);
           } else if (this.props.currentView !== 'provisioner') {
             this.setState({ clusters: [] });
             setCurrentCluster(null);

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

@@ -37,7 +37,6 @@ class ContextProvider extends Component {
     },
     currentCluster: null as ClusterType | null,
     setCurrentCluster: (currentCluster: ClusterType) => {
-      localStorage.setItem('currentCluster', currentCluster);
       this.setState({ currentCluster });
     },
     currentProject: null as ProjectType | null,