Skip to content

Commit

Permalink
fix: keep selection in cluster dashboard
Browse files Browse the repository at this point in the history
  • Loading branch information
topliceanurazvan committed Mar 9, 2023
1 parent 2a4b011 commit 3ff35cc
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
5 changes: 0 additions & 5 deletions src/components/organisms/DashboardPane/DashboardPane.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import {useCallback, useEffect, useMemo, useState} from 'react';
import {useMount} from 'react-use';

import {FundProjectionScreenOutlined} from '@ant-design/icons';

Expand Down Expand Up @@ -100,10 +99,6 @@ const DashboardPane = () => {
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [registeredKindHandlers, leftMenu, selectedNamespace, clusterResourceMetaMapRef]);

useMount(() => {
dispatch(setActiveDashboardMenu({key: 'Overview', label: 'Overview'}));
});

const setActiveMenu = useCallback(
(menuItem: DashboardMenu) => {
trackEvent('dashboard/selectKind', {kind: menuItem.key});
Expand Down
1 change: 1 addition & 0 deletions src/redux/dashboard/slice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export const dashboardSlice = createSlice({
extraReducers: builder => {
builder.addCase(startClusterConnection.fulfilled, state => {
state.tableDrawer.selectedResourceId = undefined;
state.ui.activeMenu = {key: 'Overview', label: 'Overview'};
});
},
});
Expand Down

0 comments on commit 3ff35cc

Please sign in to comment.