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

This commit is contained in:
u7837228 2024-10-20 01:56:47 +11:00
parent c77e5abba7
commit 945d85866a
3 changed files with 22 additions and 0 deletions

View file

@ -320,6 +320,14 @@ public class UploadActivity extends BaseActivity implements UploadContract.View,
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
*/

View file

@ -18,6 +18,13 @@ public interface UploadContract {
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();
/**

View file

@ -123,6 +123,9 @@ public class UploadPresenter implements UploadContract.UserActionListener {
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
@ -131,6 +134,10 @@ public class UploadPresenter implements UploadContract.UserActionListener {
repository.cleanup();
view.returnToMainActivity();
compositeDisposable.clear();
//after finish the uploadActivity, if successful,
//directly go to the upload progress activity
view.goToUploadProgressActivity();
}
});
} else {