fix: clear table settings between users and groups pages
@@ -3,8 +3,10 @@ import React, { useCallback, useState } from 'react';
import { useNavigate, useParams } from 'react-router-dom';
import Page from 'components/Page';
+import { InteractiveTableSettings } from 'components/Table/InteractiveTable';
import useFeature from 'hooks/useFeature';
import usePermissions from 'hooks/usePermissions';
+import useSettings from 'hooks/useSettings';
import GroupManagement from 'pages/Settings/GroupManagement';
import SettingsAccount from 'pages/Settings/SettingsAccount';
import UserManagement from 'pages/Settings/UserManagement';
@@ -36,16 +38,21 @@ const SettingsContent: React.FC = () => {
const navigate = useNavigate();
const { tab } = useParams<Params>();
const [tabKey, setTabKey] = useState<TabType>(tab || DEFAULT_TAB_KEY);
+ const { updateSettings } = useSettings<InteractiveTableSettings>({
+ settings: [],
+ storagePath: '',
+ });
const rbacEnabled = useFeature().isOn('rbac');
const { canViewUsers } = usePermissions();
const handleTabChange = useCallback(
(key) => {
+ updateSettings({});
setTabKey(key);
navigate(paths.settings(key), { replace: true });
},
- [navigate],
+ [navigate, updateSettings],
);
return (
