Skip to content

Commit

Permalink
Reinitialize mCurrentGutenbergPropsBuilder if null
Browse files Browse the repository at this point in the history
  • Loading branch information
aditi-bhatia committed Jun 5, 2024
1 parent fa38edf commit 5a36d78
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -680,6 +680,13 @@ public void onActivityResult(int requestCode, int resultCode, @Nullable Intent d
String blockId = data.getStringExtra(WPGutenbergWebViewActivity.ARG_BLOCK_ID);
String content = data.getStringExtra(WPGutenbergWebViewActivity.ARG_BLOCK_CONTENT);
getGutenbergContainerFragment().replaceUnsupportedBlock(content, blockId);
if (mCurrentGutenbergPropsBuilder == null) {
SavedInstanceDatabase db = SavedInstanceDatabase.Companion.getDatabase(getContext());
if (db != null) {
mCurrentGutenbergPropsBuilder = db.getParcel(ARG_GUTENBERG_PROPS_BUILDER,
GutenbergPropsBuilder.CREATOR);
}
}
// We need to send latest capabilities as JS side clears them
getGutenbergContainerFragment().updateCapabilities(mCurrentGutenbergPropsBuilder);
trackWebViewClosed("save");
Expand Down

0 comments on commit 5a36d78

Please sign in to comment.