diff --git a/packages/bruno-app/src/components/Sidebar/TitleBar/index.js b/packages/bruno-app/src/components/Sidebar/TitleBar/index.js index 7962da07f..bec0c92a5 100644 --- a/packages/bruno-app/src/components/Sidebar/TitleBar/index.js +++ b/packages/bruno-app/src/components/Sidebar/TitleBar/index.js @@ -31,10 +31,17 @@ const TitleBar = () => { }; const handleImportCollectionLocation = (collectionLocation) => { - dispatch(importCollection(importedCollection, collectionLocation)); - setImportCollectionLocationModalOpen(false); - setImportedCollection(null); - toast.success('Collection imported successfully'); + dispatch(importCollection(importedCollection, collectionLocation)) + .then(() => { + setImportCollectionLocationModalOpen(false); + setImportedCollection(null); + toast.success('Collection imported successfully'); + }) + .catch((err) => { + setImportCollectionLocationModalOpen(false); + console.error(err); + toast.error('An error occurred while importing the collection. Check the logs for more information.'); + }); }; const menuDropdownTippyRef = useRef(); diff --git a/packages/bruno-app/src/components/Welcome/index.js b/packages/bruno-app/src/components/Welcome/index.js index 7f60377b6..385a71486 100644 --- a/packages/bruno-app/src/components/Welcome/index.js +++ b/packages/bruno-app/src/components/Welcome/index.js @@ -34,10 +34,17 @@ const Welcome = () => { }; const handleImportCollectionLocation = (collectionLocation) => { - dispatch(importCollection(importedCollection, collectionLocation)); - setImportCollectionLocationModalOpen(false); - setImportedCollection(null); - toast.success('Collection imported successfully'); + dispatch(importCollection(importedCollection, collectionLocation)) + .then(() => { + setImportCollectionLocationModalOpen(false); + setImportedCollection(null); + toast.success('Collection imported successfully'); + }) + .catch((err) => { + setImportCollectionLocationModalOpen(false); + console.error(err); + toast.error('An error occurred while importing the collection. Check the logs for more information.'); + }); }; return (