Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2324,6 +2324,20 @@ private GutenbergPropsBuilder getGutenbergPropsBuilder() {
);
}

/**
* Checks if the theme supports the new gallery block with image blocks.
* Note that if the editor theme has not been initialized (usually on the first app run)
* the value returned is null and the `unstable_gallery_with_image_blocks` analytics property will not be reported.
* @return true if the the supports the new gallery block with image blocks or null if the theme is not initialized.
*/
private Boolean themeSupportsGalleryWithImageBlocks() {
EditorTheme editorTheme = mEditorThemeStore.getEditorThemeForSite(mSite);
if (editorTheme == null) {
return null;
}
return editorTheme.getThemeSupport().getGalleryWithImageBlocks();
}

/**
* Temporary method for the Editor Onboarding project to control the percentage
* of users able to use this new editor onboarding tooltip feature. This will eventually
Expand Down Expand Up @@ -3301,9 +3315,7 @@ private void onEditorFinalTouchesBeforeShowing() {
((GutenbergEditorFragment) mEditorFragment).resetUploadingMediaToFailed(mediaIds);
}
} else if (mShowAztecEditor && mEditorFragment instanceof AztecEditorFragment) {
EditorTheme editorTheme = mEditorThemeStore.getEditorThemeForSite(mSite);
Boolean supportsGalleryWithImageBlocks = editorTheme.getThemeSupport().getGalleryWithImageBlocks();
mPostEditorAnalyticsSession.start(null, canViewEditorOnboarding(), supportsGalleryWithImageBlocks);
mPostEditorAnalyticsSession.start(null, canViewEditorOnboarding(), themeSupportsGalleryWithImageBlocks());
}
}

Expand All @@ -3316,15 +3328,8 @@ public void onEditorFragmentContentReady(
// It assumes this is being called when the editor has finished loading
// If you need to refactor this, please ensure that the startup_time_ms property
// is still reflecting the actual startup time of the editor
EditorTheme editorTheme = mEditorThemeStore.getEditorThemeForSite(mSite);
Boolean supportsGalleryWithImageBlocks = null;
if (editorTheme != null) {
// Note that if the editor theme has not been initialized (usually on the first app run) the
// `unstable_gallery_with_image_blocks` analytics property will not be reported
supportsGalleryWithImageBlocks = editorTheme.getThemeSupport().getGalleryWithImageBlocks();
}
mPostEditorAnalyticsSession
.start(unsupportedBlocksList, canViewEditorOnboarding(), supportsGalleryWithImageBlocks);
.start(unsupportedBlocksList, canViewEditorOnboarding(), themeSupportsGalleryWithImageBlocks());
presentNewPageNoticeIfNeeded();

// don't start listening for Story events just now if we're waiting for a block to be replaced,
Expand Down