mirror of
https://github.com/usebruno/bruno.git
synced 2026-07-07 22:18:33 +00:00
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:
@@ -6,7 +6,6 @@ import { useDispatch, useSelector } from 'react-redux';
|
||||
import { isItemARequest, itemIsOpenedInTabs } from 'utils/tabs/index';
|
||||
import { getDefaultRequestPaneTab } from 'utils/collections/index';
|
||||
import { addTab, focusTab } from 'providers/ReduxStore/slices/tabs';
|
||||
import { hideHomePage } from 'providers/ReduxStore/slices/app';
|
||||
|
||||
const RequestsNotLoaded = ({ collection }) => {
|
||||
const dispatch = useDispatch();
|
||||
@@ -21,7 +20,6 @@ const RequestsNotLoaded = ({ collection }) => {
|
||||
const handleRequestClick = (item) => (e) => {
|
||||
e.preventDefault();
|
||||
if (isItemARequest(item)) {
|
||||
dispatch(hideHomePage());
|
||||
if (itemIsOpenedInTabs(item, tabs)) {
|
||||
dispatch(
|
||||
focusTab({
|
||||
|
||||
Reference in New Issue
Block a user