mirror of
https://github.com/usebruno/bruno.git
synced 2026-06-23 04:35:40 +00:00
Fix: Collectio-items not loading when clicking on chevron icon the first-time
This commit is contained in:
@@ -54,6 +54,16 @@ const Collection = ({ collection, searchText }) => {
|
||||
);
|
||||
};
|
||||
|
||||
const ensureCollectionIsMounted = () => {
|
||||
if (collection.mountStatus === 'unmounted') {
|
||||
dispatch(mountCollection({
|
||||
collectionUid: collection.uid,
|
||||
collectionPathname: collection.pathname,
|
||||
brunoConfig: collection.brunoConfig
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
const hasSearchText = searchText && searchText?.trim()?.length;
|
||||
const collectionIsCollapsed = hasSearchText ? false : collection.collapsed;
|
||||
|
||||
@@ -67,13 +77,7 @@ const Collection = ({ collection, searchText }) => {
|
||||
const isChevronClick = event.target.closest('svg')?.classList.contains('chevron-icon');
|
||||
setTimeout(scrollToTheActiveTab, 50);
|
||||
|
||||
if (collection.mountStatus === 'unmounted') {
|
||||
dispatch(mountCollection({
|
||||
collectionUid: collection.uid,
|
||||
collectionPathname: collection.pathname,
|
||||
brunoConfig: collection.brunoConfig
|
||||
}));
|
||||
}
|
||||
ensureCollectionIsMounted();
|
||||
|
||||
dispatch(collapseCollection(collection.uid));
|
||||
|
||||
@@ -95,6 +99,7 @@ const Collection = ({ collection, searchText }) => {
|
||||
const handleCollectionCollapse = (e) => {
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
ensureCollectionIsMounted();
|
||||
dispatch(collapseCollection(collection.uid));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user