Fixed permanent 'uploading' icon on files that are automatically renamed during the...
authorDavid A. Velasco <dvelasco@solidgear.es>
Fri, 21 Aug 2015 12:55:52 +0000 (14:55 +0200)
committerDavid A. Velasco <dvelasco@solidgear.es>
Fri, 25 Sep 2015 13:13:53 +0000 (15:13 +0200)
src/com/owncloud/android/files/services/FileUploader.java

index 7c36996..1490934 100644 (file)
@@ -590,8 +590,18 @@ public class FileUploader extends Service
                 } finally {
                     Log_OC.v("NOW " + TAG + ", thread " + Thread.currentThread().getName(),
                             "Removing payload " + mCurrentUpload.getRemotePath());
-                    Pair<UploadFileOperation, String> removeResult =
-                            mPendingUploads.removePayload(mCurrentAccount, mCurrentUpload.getRemotePath());
+                    Pair<UploadFileOperation, String> removeResult;
+                    if (mCurrentUpload.wasRenamed()) {
+                        removeResult = mPendingUploads.removePayload(
+                                mCurrentAccount,
+                                mCurrentUpload.getOldFile().getRemotePath()
+                        );
+                    } else {
+                        removeResult = mPendingUploads.removePayload(
+                                mCurrentAccount,
+                                mCurrentUpload.getRemotePath()
+                        );
+                    }
 
                     /// notify result
                     notifyUploadResult(mCurrentUpload, uploadResult);