Skip to content

Commit

Permalink
Gutenberg/inject css on both page visible and page started and show c…
Browse files Browse the repository at this point in the history
…orrect title in web view (#13122)
  • Loading branch information
marecar3 authored Oct 14, 2020
1 parent df54f98 commit 44128e7
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public class WPGutenbergWebViewActivity extends GutenbergWebViewActivity {

public static final String ARG_USER_ID = "authenticated_user_id";
public static final String ARG_BLOCK_ID = "block_id";
public static final String ARG_BLOCK_NAME = "block_name";
public static final String ARG_BLOCK_TITLE = "block_title";
public static final String ARG_BLOCK_CONTENT = "block_content";

private boolean mIsJetpackSsoEnabled;
Expand Down Expand Up @@ -73,9 +73,9 @@ && getIntent().getExtras() != null) {

@Override
protected String getToolbarTitle() {
String blockName = getIntent().getExtras().getString(ARG_BLOCK_NAME);
if (blockName != null) {
return String.format(getString(R.string.menu_toolbar_title), blockName);
String blockTitle = getIntent().getExtras().getString(ARG_BLOCK_TITLE);
if (blockTitle != null) {
return String.format(getString(R.string.menu_toolbar_title), blockTitle);
}
return "";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,8 @@ public void gutenbergDidRequestUnsupportedBlockFallback(UnsupportedBlock unsuppo
openGutenbergWebViewActivity(
unsupportedBlock.getContent(),
unsupportedBlock.getId(),
unsupportedBlock.getName()
unsupportedBlock.getName(),
unsupportedBlock.getTitle()
);
}
},
Expand Down Expand Up @@ -357,7 +358,7 @@ public void run() {
return view;
}

private void openGutenbergWebViewActivity(String content, String blockId, String blockName) {
private void openGutenbergWebViewActivity(String content, String blockId, String blockName, String blockTitle) {
GutenbergWebViewAuthorizationData gutenbergWebViewAuthData =
getArguments().getParcelable(ARG_GUTENBERG_WEB_VIEW_AUTH_DATA);

Expand All @@ -367,7 +368,7 @@ private void openGutenbergWebViewActivity(String content, String blockId, String

Intent intent = new Intent(getActivity(), WPGutenbergWebViewActivity.class);
intent.putExtra(WPGutenbergWebViewActivity.ARG_BLOCK_ID, blockId);
intent.putExtra(WPGutenbergWebViewActivity.ARG_BLOCK_NAME, blockName);
intent.putExtra(WPGutenbergWebViewActivity.ARG_BLOCK_TITLE, blockTitle);
intent.putExtra(WPGutenbergWebViewActivity.ARG_BLOCK_CONTENT, content);
intent.putExtra(WPGutenbergWebViewActivity.ARG_GUTENBERG_WEB_VIEW_AUTH_DATA, gutenbergWebViewAuthData);

Expand Down
2 changes: 1 addition & 1 deletion libs/gutenberg-mobile

0 comments on commit 44128e7

Please sign in to comment.