Skip to content

Commit 18f2b72

Browse files
committed
putMethod can also be cancelled on user interaction as per NC PR: nextcloud#1061
1 parent caade53 commit 18f2b72

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

library/src/main/java/com/owncloud/android/lib/resources/files/ChunkedFileUploadRemoteOperation.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,13 @@ protected RemoteOperationResult run(OwnCloudClient client) {
222222

223223
result = new RemoteOperationResult(isSuccess(moveResult), moveMethod);
224224
} catch (Exception e) {
225-
if (moveMethod != null && moveMethod.isAborted()) {
225+
if (putMethod != null && putMethod.isAborted()) {
226+
if (cancellationRequested.get() && cancellationReason != null) {
227+
result = new RemoteOperationResult(cancellationReason);
228+
} else {
229+
result = new RemoteOperationResult(new OperationCancelledException());
230+
}
231+
} else if (moveMethod != null && moveMethod.isAborted()) {
226232
if (cancellationRequested.get() && cancellationReason != null) {
227233
result = new RemoteOperationResult(cancellationReason);
228234
} else {

0 commit comments

Comments
 (0)