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

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

jusrhee 5 лет назад
Родитель
Сommit
befbaed733
1 измененных файлов с 1 добавлено и 7 удалено
  1. 1 7
      dashboard/src/main/home/cluster-dashboard/ClusterDashboard.tsx

+ 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