瀏覽代碼

Merge pull request #9691 from nextcloud/fix/sync-conflict

Improvements in sync conflict resolution
Álvaro Brey 3 年之前
父節點
當前提交
92f3b6df87

+ 3 - 4
src/main/java/com/owncloud/android/files/services/FileDownloader.java

@@ -632,6 +632,9 @@ public class FileDownloader extends Service
 
         if (!downloadResult.isCancelled()) {
             if (downloadResult.isSuccess()) {
+                if (conflictUploadId > 0) {
+                    uploadsStorageManager.removeUpload(conflictUploadId);
+                }
                 // Dont show notification except an error has occured.
                 return;
             }
@@ -667,10 +670,6 @@ public class FileDownloader extends Service
 
                 // Remove success notification
                 if (downloadResult.isSuccess()) {
-                    if (conflictUploadId > 0) {
-                        uploadsStorageManager.removeUpload(conflictUploadId);
-                    }
-
                     // Sleep 2 seconds, so show the notification before remove it
                     NotificationUtils.cancelWithDelay(mNotificationManager,
                                                       R.string.downloader_download_succeeded_ticker, 2000);

+ 2 - 0
src/main/java/com/owncloud/android/ui/activity/ConflictsResolveActivity.java

@@ -149,6 +149,8 @@ public class ConflictsResolveActivity extends FileActivity implements OnConflict
                         intent.putExtra(FileDownloader.EXTRA_FILE, file);
                         intent.putExtra(EXTRA_CONFLICT_UPLOAD_ID, conflictUploadId);
                         startService(intent);
+                    } else {
+                        uploadsStorageManager.removeUpload(upload);
                     }
                     break;
             }