Skip to content

Commit

Permalink
fix: possible delay start for WorkRequest causing UI inconsistency
Browse files Browse the repository at this point in the history
  • Loading branch information
aanorbel committed Jun 5, 2024
1 parent ea4e68b commit 199d0e8
Showing 1 changed file with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,13 @@ private void onManualUpdatesFetchComplete(WorkInfo workInfo) {
if (workInfo != null) {
if (workInfo.getProgress().getInt(PROGRESS, -1) >= 0) {
binding.reviewUpdateNotificationFragment.setVisibility(View.VISIBLE);
getSupportFragmentManager()
.beginTransaction()
.add(
R.id.review_update_notification_fragment,
OONIRunDynamicProgressBar.newInstance(ProgressType.UPDATE_LINK, null),
OONIRunDynamicProgressBar.getTAG() + "_review_update_enqueued_notification"
).commit();
}
switch (workInfo.getState()) {
case SUCCEEDED -> {
Expand Down Expand Up @@ -274,14 +281,6 @@ public void onCloseButtonClicked() {
).commit();
}

case ENQUEUED -> getSupportFragmentManager()
.beginTransaction()
.add(
R.id.review_update_notification_fragment,
OONIRunDynamicProgressBar.newInstance(ProgressType.UPDATE_LINK, null),
OONIRunDynamicProgressBar.getTAG() + "_review_update_enqueued_notification"
).commit();

case FAILED -> Snackbar.make(
binding.getRoot(),
R.string.Modal_Error,
Expand Down

0 comments on commit 199d0e8

Please sign in to comment.