refactor: centralize tab management (#6494)

* refactor: centralize tab management by removing redundant hide calls in Collection components

- Removed dispatch calls for hiding home and API spec pages from Collection and CollectionItem components.
- Added logic in app slice to automatically hide these pages when a tab is added or focused, improving code maintainability.

* refactor: remove redundant hideHomePage dispatches from components
This commit is contained in:
Abhishek S Lal
2025-12-23 19:19:25 +05:30
committed by GitHub
parent aeb6b12b06
commit d93d1eacdb
7 changed files with 16 additions and 19 deletions

View File

@@ -3,7 +3,6 @@ import { useSelector, useDispatch } from 'react-redux';
import { IconBox, IconTrash, IconEdit, IconShare, IconDots } from '@tabler/icons';
import { removeCollectionFromWorkspaceAction } from 'providers/ReduxStore/slices/workspaces/actions';
import { addTab } from 'providers/ReduxStore/slices/tabs';
import { hideHomePage } from 'providers/ReduxStore/slices/app';
import { mountCollection } from 'providers/ReduxStore/slices/collections/actions';
import { normalizePath } from 'utils/common/path';
import toast from 'react-hot-toast';
@@ -117,8 +116,6 @@ const CollectionsList = ({ workspace }) => {
})
);
dispatch(hideHomePage());
dispatch(
addTab({
uid: collection.uid,