Browse Source

removed a check in KEEP_SERVER switch clause. 1) The check prevents solving file conflicts (keep server) correctly. 2) The check involves FileUploader.LOCAL_BEHAVIOUR_DELETE, intended use is for media file uploads.

wknds 3 năm trước cách đây
mục cha
commit
b4c1620aed

+ 6 - 15
src/main/java/com/owncloud/android/ui/activity/ConflictsResolveActivity.java

@@ -142,14 +142,12 @@ public class ConflictsResolveActivity extends FileActivity implements OnConflict
                     uploadsStorageManager.removeUpload(upload);
                     break;
                 case KEEP_SERVER: // Download
-                    if (!shouldDeleteLocal()) {
-                        // Overwrite local file
-                        Intent intent = new Intent(getBaseContext(), FileDownloader.class);
-                        intent.putExtra(FileDownloader.EXTRA_USER, getUser().orElseThrow(RuntimeException::new));
-                        intent.putExtra(FileDownloader.EXTRA_FILE, file);
-                        intent.putExtra(EXTRA_CONFLICT_UPLOAD_ID, conflictUploadId);
-                        startService(intent);
-                    }
+                    // Overwrite local file
+                    Intent intent = new Intent(getBaseContext(), FileDownloader.class);
+                    intent.putExtra(FileDownloader.EXTRA_USER, getUser().orElseThrow(RuntimeException::new));
+                    intent.putExtra(FileDownloader.EXTRA_FILE, file);
+                    intent.putExtra(EXTRA_CONFLICT_UPLOAD_ID, conflictUploadId);
+                    startService(intent);
                     break;
             }
 
@@ -242,11 +240,4 @@ public class ConflictsResolveActivity extends FileActivity implements OnConflict
         runOnUiThread(() -> Toast.makeText(this, R.string.conflict_dialog_error, Toast.LENGTH_LONG).show());
         finish();
     }
-
-    /**
-     * @return whether the local version of the files is to be deleted.
-     */
-    private boolean shouldDeleteLocal() {
-        return localBehaviour == FileUploader.LOCAL_BEHAVIOUR_DELETE;
-    }
 }