Skip to content

Commit 47f82bb

Browse files
fix: don't fight console to setActiveNamespace
1 parent 0234fa4 commit 47f82bb

2 files changed

Lines changed: 0 additions & 12 deletions

File tree

web/src/components/dashboards/legacy/useLegacyDashboardsProject.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,6 @@ export const useLegacyDashboardsProject = () => {
3030
setOpenshiftProject(activeNamespace);
3131
}
3232
} else {
33-
if (routeNamespace && activeNamespace !== routeNamespace) {
34-
setActiveNamespace(routeNamespace);
35-
}
3633
if (variableNamespace && variableNamespace !== routeNamespace) {
3734
dispatch(
3835
dashboardsPatchVariable('namespace', {

web/src/components/hooks/useMonitoringNamespace.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
import { useActiveNamespace } from '@openshift-console/dynamic-plugin-sdk';
2-
import { useEffect } from 'react';
32
import { useParams } from 'react-router';
4-
import { useMonitoring } from '../../hooks/useMonitoring';
53

64
/**
75
* Utility hook to synchronize the namespace route in the URL with the activeNamespace
@@ -12,13 +10,6 @@ import { useMonitoring } from '../../hooks/useMonitoring';
1210
export const useMonitoringNamespace = () => {
1311
const { ns: routeNamespace } = useParams<{ ns?: string }>();
1412
const [activeNamespace, setActiveNamespace] = useActiveNamespace();
15-
const { displayNamespaceSelector } = useMonitoring();
16-
17-
useEffect(() => {
18-
if (routeNamespace && activeNamespace !== routeNamespace) {
19-
setActiveNamespace(routeNamespace);
20-
}
21-
}, [routeNamespace, activeNamespace, setActiveNamespace, displayNamespaceSelector]);
2213

2314
return {
2415
namespace: routeNamespace || activeNamespace,

0 commit comments

Comments
 (0)