Kaynağa Gözat

only change view to dashboard if not on provisioning from clustersection

jusrhee 5 yıl önce
ebeveyn
işleme
d63bc70d33

+ 2 - 1
dashboard/src/main/home/sidebar/ClusterSection.tsx

@@ -13,6 +13,7 @@ type PropsType = {
   releaseDrawer: () => void,
   setWelcome: (x: boolean) => void,
   setCurrentView: (x: string) => void,
+  currentView: string,
   isSelected: boolean,
   forceRefreshClusters: boolean,
   setRefreshClusters: (x: boolean) => void,
@@ -74,7 +75,7 @@ export default class ClusterSection extends Component<PropsType, StateType> {
     if (prevProps !== this.props) {
 
       // Refresh clusters on project change 
-      if (this.state.prevProjectId !== this.context.currentProject.id) {
+      if (this.state.prevProjectId !== this.context.currentProject.id && this.props.currentView !== 'provisioner') {
         this.updateClusters();
         this.setState({ prevProjectId: this.context.currentProject.id });
       } else if (this.props.forceRefreshClusters === true) {

+ 1 - 0
dashboard/src/main/home/sidebar/Sidebar.tsx

@@ -132,6 +132,7 @@ export default class Sidebar extends Component<PropsType, StateType> {
             forceCloseDrawer={this.state.forceCloseDrawer} 
             releaseDrawer={() => this.setState({ forceCloseDrawer: false })}
             setWelcome={this.props.setWelcome}
+            currentView={this.props.currentView}
             setCurrentView={this.props.setCurrentView}
             isSelected={this.props.currentView === 'cluster-dashboard'}
             forceRefreshClusters={this.props.forceRefreshClusters}