Skip to content

Commit

Permalink
fix: start cluster connection
Browse files Browse the repository at this point in the history
  • Loading branch information
topliceanurazvan committed Feb 22, 2023
1 parent 6171068 commit d2816b5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 5 additions & 0 deletions src/redux/reducers/ui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {Entries} from 'type-fest';
import {DEFAULT_PANE_CONFIGURATION} from '@constants/constants';

import initialState from '@redux/initialState';
import {loadClusterResources} from '@redux/thunks/cluster';
import {setRootFolder} from '@redux/thunks/setRootFolder';

import {ROOT_FILE_ENTRY} from '@shared/constants/fileEntry';
Expand Down Expand Up @@ -348,6 +349,10 @@ export const uiSlice = createSlice({
})
.addCase(setRootFolder.rejected, state => {
state.isFolderLoading = false;
})
.addCase(loadClusterResources.fulfilled, state => {
state.leftMenu.selection = 'dashboard';
state.leftMenu.isActive = true;
});
},
});
Expand Down
3 changes: 0 additions & 3 deletions src/redux/thunks/cluster/startClusterConnection.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import {createAsyncThunk} from '@reduxjs/toolkit';

import {setClusterProxyPort} from '@redux/appConfig';
import {setLeftMenuSelection} from '@redux/reducers/ui';
import {disconnectFromCluster} from '@redux/services/clusterResourceWatcher';
import {stopPreview} from '@redux/services/preview';

Expand Down Expand Up @@ -39,7 +38,6 @@ export const startClusterConnection = createAsyncThunk<
thunkAPI.dispatch(reloadClusterResources({context, namespace}));
} else {
thunkAPI.dispatch(loadClusterResources({context, namespace}));
thunkAPI.dispatch(setLeftMenuSelection('dashboard'));
}

return;
Expand All @@ -50,7 +48,6 @@ export const startClusterConnection = createAsyncThunk<
thunkAPI.dispatch(reloadClusterResources({context, namespace, port: clusterProxyPort}));
} else {
thunkAPI.dispatch(loadClusterResources({context, namespace, port: clusterProxyPort}));
thunkAPI.dispatch(setLeftMenuSelection('dashboard'));
}

return;
Expand Down

0 comments on commit d2816b5

Please sign in to comment.