Browse Source

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

jusrhee 5 năm trước cách đây
mục cha
commit
befbaed733

+ 1 - 7
dashboard/src/main/home/cluster-dashboard/ClusterDashboard.tsx

@@ -26,16 +26,10 @@ type StateType = {
 export default class ClusterDashboard extends Component<PropsType, StateType> {
   state = {
     namespace: 'default',
-    sortType: 'Newest',
+    sortType: (localStorage.getItem("SortType") ? localStorage.getItem('SortType') : 'Newest'),
     currentChart: null as (ChartType | null)
   }
 
-  componentDidMount() {
-    if (localStorage.getItem("SortType")) {
-      this.setState({ sortType: localStorage.getItem("SortType") });
-    }
-  }
-
   componentDidUpdate(prevProps: PropsType) {
     localStorage.setItem("SortType", this.state.sortType);
     // Reset namespace filter and close expanded chart on cluster change