feat: add hideApiSpecPage dispatch to Collection and CollectionItem components (#6344)

This commit is contained in:
naman-bruno
2025-12-08 14:24:47 +05:30
committed by GitHub
parent dc107f8b96
commit 354e8d7496
2 changed files with 6 additions and 2 deletions

View File

@@ -39,7 +39,7 @@ import GenerateCodeItem from './GenerateCodeItem';
import { isItemARequest, isItemAFolder } from 'utils/tabs';
import { doesRequestMatchSearchText, doesFolderHaveItemsMatchSearchText } from 'utils/collections/search';
import { getDefaultRequestPaneTab } from 'utils/collections';
import { hideHomePage } from 'providers/ReduxStore/slices/app';
import { hideHomePage, hideApiSpecPage } from 'providers/ReduxStore/slices/app';
import toast from 'react-hot-toast';
import StyledWrapper from './StyledWrapper';
import NetworkError from 'components/ResponsePane/NetworkError/index';
@@ -222,6 +222,7 @@ const CollectionItem = ({ item, collectionUid, collectionPathname, searchText })
const isRequest = isItemARequest(item);
if (isRequest) {
dispatch(hideHomePage());
dispatch(hideApiSpecPage());
if (isTabForItemPresent) {
dispatch(
focusTab({
@@ -239,6 +240,8 @@ const CollectionItem = ({ item, collectionUid, collectionPathname, searchText })
})
);
} else {
dispatch(hideHomePage());
dispatch(hideApiSpecPage());
dispatch(
addTab({
uid: item.uid,

View File

@@ -24,7 +24,7 @@ import Dropdown from 'components/Dropdown';
import { toggleCollection, collapseFullCollection } from 'providers/ReduxStore/slices/collections';
import { mountCollection, moveCollectionAndPersist, handleCollectionItemDrop, pasteItem } from 'providers/ReduxStore/slices/collections/actions';
import { useDispatch, useSelector } from 'react-redux';
import { hideHomePage } from 'providers/ReduxStore/slices/app';
import { hideApiSpecPage, hideHomePage } from 'providers/ReduxStore/slices/app';
import { addTab, makeTabPermanent } from 'providers/ReduxStore/slices/tabs';
import toast from 'react-hot-toast';
import NewRequest from 'components/Sidebar/NewRequest';
@@ -112,6 +112,7 @@ const Collection = ({ collection, searchText }) => {
if (!isChevronClick) {
dispatch(hideHomePage()); // @TODO Playwright tests are often stuck on home page, rather than collection settings tab. Revisit for a proper fix.
dispatch(hideApiSpecPage());
dispatch(
addTab({
uid: collection.uid,