Skip to content

Commit 9c1c95f

Browse files
Fix for #5846: After uploading via Nearby, I am sent back to Nearby, where I am mislead into thinking that I must upload again #5846 (#5874)
Co-authored-by: Nicolas Raoul <[email protected]>
1 parent ba7348f commit 9c1c95f

File tree

3 files changed

+22
-0
lines changed

3 files changed

+22
-0
lines changed

app/src/main/java/fr/free/nrw/commons/upload/UploadActivity.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,14 @@ public void returnToMainActivity() {
320320
finish();
321321
}
322322

323+
/**
324+
* go to the uploadProgress activity to check the status of uploading
325+
*/
326+
@Override
327+
public void goToUploadProgressActivity() {
328+
startActivity(new Intent(this, UploadProgressActivity.class));
329+
}
330+
323331
/**
324332
* Show/Hide the progress dialog
325333
*/

app/src/main/java/fr/free/nrw/commons/upload/UploadContract.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,13 @@ public interface View {
1818

1919
void returnToMainActivity();
2020

21+
/**
22+
* When submission successful, go to the loadProgressActivity to hint the user this
23+
* submission is valid. And the user will see the upload progress in this activity;
24+
* Fixes: <a href="https://github.com/commons-app/apps-android-commons/issues/5846">Issue</a>
25+
*/
26+
void goToUploadProgressActivity();
27+
2128
void askUserToLogIn();
2229

2330
/**

app/src/main/java/fr/free/nrw/commons/upload/UploadPresenter.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,9 @@ public void onError(Throwable e) {
123123
view.returnToMainActivity();
124124
compositeDisposable.clear();
125125
Timber.e("failed to upload: " + e.getMessage());
126+
127+
//is submission error, not need to go to the uploadActivity
128+
//not start the uploading progress
126129
}
127130

128131
@Override
@@ -131,6 +134,10 @@ public void onComplete() {
131134
repository.cleanup();
132135
view.returnToMainActivity();
133136
compositeDisposable.clear();
137+
138+
//after finish the uploadActivity, if successful,
139+
//directly go to the upload progress activity
140+
view.goToUploadProgressActivity();
134141
}
135142
});
136143
} else {

0 commit comments

Comments
 (0)