Skip to content

Commit

Permalink
Fix for #5846: After uploading via Nearby, I am sent back to Nearby, …
Browse files Browse the repository at this point in the history
…where I am mislead into thinking that I must upload again #5846
  • Loading branch information
whe128 committed Oct 19, 2024
1 parent c77e5ab commit 945d858
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,14 @@ public void returnToMainActivity() {
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
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@ public interface View {

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();

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,9 @@ public void onError(Throwable e) {
view.returnToMainActivity();
compositeDisposable.clear();
Timber.e("failed to upload: " + e.getMessage());

//is submission error, not need to go to the uploadActivity
//not start the uploading progress
}

@Override
Expand All @@ -131,6 +134,10 @@ public void onComplete() {
repository.cleanup();
view.returnToMainActivity();
compositeDisposable.clear();

//after finish the uploadActivity, if successful,
//directly go to the upload progress activity
view.goToUploadProgressActivity();
}
});
} else {
Expand Down

0 comments on commit 945d858

Please sign in to comment.