Skip to content

Commit

Permalink
Add lifecycle check to the featured image confirmation dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
irfano committed May 16, 2024
1 parent bafd3c3 commit b57fb87
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import androidx.fragment.app.FragmentActivity;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentTransaction;
import androidx.lifecycle.Lifecycle.State;
import androidx.lifecycle.LiveData;

import com.android.volley.toolbox.ImageLoader;
Expand Down Expand Up @@ -900,6 +901,10 @@ public void onClick(DialogInterface dialog, int id) {

@UiThread
public void showFeaturedImageConfirmationDialog(final int mediaId) {
if (!getLifecycle().getCurrentState().isAtLeast(State.CREATED)) {
return;
}

GutenbergDialogFragment dialog = new GutenbergDialogFragment();
dialog.initialize(
TAG_REPLACE_FEATURED_DIALOG,
Expand Down

0 comments on commit b57fb87

Please sign in to comment.