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 <nicolas.raoul@gmail.com>
This commit is contained in:
whe128 2024-10-23 03:56:02 +11:00 committed by GitHub
parent ba7348f83f
commit 9c1c95f5cf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 22 additions and 0 deletions

View file

@ -320,6 +320,14 @@ public class UploadActivity extends BaseActivity implements UploadContract.View,
finish(); finish();
} }
/**
* go to the uploadProgress activity to check the status of uploading
*/
@Override
public void goToUploadProgressActivity() {
startActivity(new Intent(this, UploadProgressActivity.class));
}
/** /**
* Show/Hide the progress dialog * Show/Hide the progress dialog
*/ */

View file

@ -18,6 +18,13 @@ public interface UploadContract {
void returnToMainActivity(); void returnToMainActivity();
/**
* When submission successful, go to the loadProgressActivity to hint the user this
* submission is valid. And the user will see the upload progress in this activity;
* Fixes: <a href="https://github.com/commons-app/apps-android-commons/issues/5846">Issue</a>
*/
void goToUploadProgressActivity();
void askUserToLogIn(); void askUserToLogIn();
/** /**

View file

@ -123,6 +123,9 @@ public class UploadPresenter implements UploadContract.UserActionListener {
view.returnToMainActivity(); view.returnToMainActivity();
compositeDisposable.clear(); compositeDisposable.clear();
Timber.e("failed to upload: " + e.getMessage()); Timber.e("failed to upload: " + e.getMessage());
//is submission error, not need to go to the uploadActivity
//not start the uploading progress
} }
@Override @Override
@ -131,6 +134,10 @@ public class UploadPresenter implements UploadContract.UserActionListener {
repository.cleanup(); repository.cleanup();
view.returnToMainActivity(); view.returnToMainActivity();
compositeDisposable.clear(); compositeDisposable.clear();
//after finish the uploadActivity, if successful,
//directly go to the upload progress activity
view.goToUploadProgressActivity();
} }
}); });
} else { } else {