@@ -186,9 +186,6 @@ function DriveItemInfoModal(): JSX.Element {
186186 return decryptedFilePath ;
187187 }
188188
189- setDownloadProgress ( { totalBytes : 0 , progress : 0 , bytesReceived : 0 } ) ;
190- setExporting ( true ) ;
191-
192189 let downloadPath : string ;
193190
194191 if ( isEmptyFile ( item ) ) {
@@ -198,10 +195,11 @@ function DriveItemInfoModal(): JSX.Element {
198195 if ( ! item . fileId ) {
199196 throw new Error ( 'Item fileID not found for non-empty file' ) ;
200197 }
198+ setDownloadProgress ( { totalBytes : 0 , progress : 0 , bytesReceived : 0 } ) ;
199+ setExporting ( true ) ;
201200 downloadPath = await downloadItem ( item . fileId , item . bucket as string , decryptedFilePath , fileSize ) ;
201+ setExporting ( false ) ;
202202 }
203-
204- setExporting ( false ) ;
205203 await fs . shareFile ( {
206204 title : item . name ,
207205 fileUri : downloadPath ,
@@ -247,13 +245,13 @@ function DriveItemInfoModal(): JSX.Element {
247245
248246 // 2. If the file doesn't exists, download it
249247 if ( ! existsDecrypted ) {
250- setExporting ( true ) ;
251248 if ( isEmptyFile ( item ) ) {
252249 await drive . file . createEmptyDownloadedFile ( decryptedFilePath ) ;
253250 } else {
251+ setExporting ( true ) ;
254252 await downloadItem ( item . fileId as string , item . bucket as string , decryptedFilePath , fileSize ) ;
253+ setExporting ( false ) ;
255254 }
256- setExporting ( false ) ;
257255 }
258256
259257 // 3. Copy the decrypted file (is a tmp, so this will dissapear, that's why we copy it)
@@ -307,6 +305,8 @@ function DriveItemInfoModal(): JSX.Element {
307305 fileUri : decryptedFilePath ,
308306 saveToiOSFiles : true ,
309307 } ) ;
308+
309+ notifications . success ( strings . messages . driveDownloadSuccess ) ;
310310 } catch ( error ) {
311311 notifications . error ( strings . errors . generic . message ) ;
312312 logger . error ( 'Error on handleiOSSaveToFiles function:' , JSON . stringify ( error ) ) ;
0 commit comments