forked from extern/bruno
fix: fixed issue in react hook order during search (#106)
This commit is contained in:
parent
3f6fcdd582
commit
b1edaba1c6
@ -55,12 +55,6 @@ const Collection = ({ collection, searchText }) => {
|
|||||||
dispatch(collectionClicked(collection.uid));
|
dispatch(collectionClicked(collection.uid));
|
||||||
};
|
};
|
||||||
|
|
||||||
if (searchText && searchText.length) {
|
|
||||||
if (!doesCollectionHaveItemsMatchingSearchText(collection, searchText)) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const handleExportClick = () => {
|
const handleExportClick = () => {
|
||||||
const collectionCopy = cloneDeep(collection);
|
const collectionCopy = cloneDeep(collection);
|
||||||
exportCollection(transformCollectionToSaveToIdb(collectionCopy));
|
exportCollection(transformCollectionToSaveToIdb(collectionCopy));
|
||||||
@ -80,6 +74,12 @@ const Collection = ({ collection, searchText }) => {
|
|||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (searchText && searchText.length) {
|
||||||
|
if (!doesCollectionHaveItemsMatchingSearchText(collection, searchText)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// we need to sort request items by seq property
|
// we need to sort request items by seq property
|
||||||
const sortRequestItems = (items = []) => {
|
const sortRequestItems = (items = []) => {
|
||||||
return items.sort((a, b) => a.seq - b.seq);
|
return items.sort((a, b) => a.seq - b.seq);
|
||||||
|
Loading…
Reference in New Issue
Block a user