File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
client/src/screens/browse/components/folder-info Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -193,14 +193,22 @@ const FolderInfo = ({
193193
194194 // Usage function remains the same
195195 const downloadAndSaveFolder = async ( folderId , folderName = "folder" ) => {
196+ let toastId ;
196197 try {
197- toast . info ( "Preparing to download folder..." ) ;
198+ // Create a persistent toast that doesn't auto-close
199+ toastId = toast . info ( "Preparing to download folder..." , {
200+ autoClose : false ,
201+ closeOnClick : false ,
202+ closeButton : false ,
203+ draggable : false ,
204+ } ) ;
198205
199206 // Use either the fixed version or the alternative approach
200207 const zip = await downloadFolder ( folderId ) ;
201208 // const zip = await downloadFolderAlternative(folderId);
202209
203210 if ( ! zip ) {
211+ toast . dismiss ( toastId ) ;
204212 toast . error ( "Failed to create folder archive." ) ;
205213 return ;
206214 }
@@ -215,9 +223,13 @@ const FolderInfo = ({
215223 // Save the ZIP file using saveAs
216224 saveAs ( zipBlob , `${ folderName } .zip` ) ;
217225
226+ toast . dismiss ( toastId ) ;
218227 toast . success ( "Folder Ready for download!" ) ;
219228 } catch ( error ) {
220229 console . error ( "Error in downloadAndSaveFolder:" , error ) ;
230+ if ( toastId ) {
231+ toast . dismiss ( toastId ) ;
232+ }
221233 toast . error ( "Failed to download folder." ) ;
222234 }
223235 } ;
You can’t perform that action at this time.
0 commit comments