Skip to content

Commit

Permalink
Revert "MainActivity: remove automatic retry logic"
Browse files Browse the repository at this point in the history
This reverts commit 1ebb117.
  • Loading branch information
RitikaPahwa4444 committed Jul 14, 2023
1 parent 1ebb117 commit 2dd2be1
Showing 1 changed file with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,21 @@ public boolean onOptionsItemSelected(MenuItem item) {
}
}

/**
* Retry all failed uploads as soon as the user returns to the app
*/
@SuppressLint("CheckResult")
private void retryAllFailedUploads() {
contributionDao.
getContribution(Collections.singletonList(Contribution.STATE_FAILED))
.subscribeOn(Schedulers.io())
.subscribe(failedUploads -> {
for (Contribution contribution: failedUploads) {
contributionsFragment.retryUpload(contribution);
}
});
}

public void toggleLimitedConnectionMode() {
defaultKvStore.putBoolean(CommonsApplication.IS_LIMITED_CONNECTION_MODE_ENABLED,
!defaultKvStore
Expand Down Expand Up @@ -411,6 +426,7 @@ protected void onResume() {
WelcomeActivity.startYourself(this);
}

retryAllFailedUploads();
}

@Override
Expand Down

0 comments on commit 2dd2be1

Please sign in to comment.