diff --git a/packages/bruno-app/src/components/ShareCollection/index.js b/packages/bruno-app/src/components/ShareCollection/index.js index 7fb5fd523..5ab1855a5 100644 --- a/packages/bruno-app/src/components/ShareCollection/index.js +++ b/packages/bruno-app/src/components/ShareCollection/index.js @@ -14,9 +14,15 @@ const ShareCollection = ({ onClose, collectionUid }) => { const collection = useSelector((state) => findCollectionByUid(state.collections.collections, collectionUid)); const isCollectionLoading = areItemsLoading(collection); - const hasGrpcRequests = useMemo(() => { + const hasNonExportableRequestTypes = useMemo(() => { + let types = new Set() const checkItem = (item) => { if (item.type === 'grpc-request') { + types.add("gRPC") + return true; + } + if (item.type === 'ws-request') { + types.add("WebSocket") return true; } if (item.items) { @@ -24,7 +30,10 @@ const ShareCollection = ({ onClose, collectionUid }) => { } return false; }; - return collection?.items?.some(checkItem) || false; + return { + has: collection?.items?.filter(checkItem).length || false, + types:[...types], + } }, [collection]); const handleExportBrunoCollection = () => { @@ -75,10 +84,10 @@ const ShareCollection = ({ onClose, collectionUid }) => { }`} onClick={isCollectionLoading ? undefined : handleExportPostmanCollection} > - {hasGrpcRequests && ( + {hasNonExportableRequestTypes.has && (
- Note: gRPC requests in this collection will not be exported + Note: {hasNonExportableRequestTypes.types.join(', ')} requests in this collection will not be exported
)}