File tree Expand file tree Collapse file tree 1 file changed +12
-10
lines changed Expand file tree Collapse file tree 1 file changed +12
-10
lines changed Original file line number Diff line number Diff line change @@ -873,17 +873,19 @@ export default class DownloadQueue {
873873 } else {
874874 if ( this . isTaskDownloading ( task ) ) {
875875 task . stop ( ) ;
876+ }
876877
877- if ( spec && ! spec . finished ) {
878- try {
879- // There might be a partially downloaded file on disk. We need to
880- // get rid of it in case a lazy-delete spec is revived, at which
881- // point an existing file on disk will be taken to be a
882- // successfully downloaded one.
883- await RNFS . unlink ( spec . path ) ;
884- } catch {
885- // Expected for missing files
886- }
878+ // Given logic in the bigger "if" above, only unfinished lazy-deletes
879+ // should pass this.
880+ if ( spec && ! spec . finished ) {
881+ try {
882+ // There might be a partially downloaded file on disk. We need to
883+ // get rid of it in case a lazy-delete spec is revived, at which
884+ // point an existing file on disk will be taken to be a
885+ // successfully downloaded one.
886+ await RNFS . unlink ( spec . path ) ;
887+ } catch {
888+ // Expected for missing files
887889 }
888890 }
889891 }
You can’t perform that action at this time.
0 commit comments