Skip to content

Commit

Permalink
Adds a new origin for the promote post widget (#93088)
Browse files Browse the repository at this point in the history
* Adds a new origin for the promote post widget
  • Loading branch information
sbarbosa authored Aug 6, 2024
1 parent 2f046f9 commit 8f631c4
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions client/lib/promote-post/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ declare global {
showGetStartedMessage?: boolean;
onGetStartedMessageClose?: ( dontShowAgain: boolean ) => void;
source?: string;
isRunningInBlazePlugin?: boolean;
isRunningInWooBlaze?: boolean;
isRunningInJetpack?: boolean;
jetpackXhrParams?: {
Expand Down Expand Up @@ -133,6 +134,8 @@ export const getDSPOrigin = ( originProps: DSPOriginProps | undefined ) => {
// We need to check for Woo first, because Woo Blaze is also running in Jetpack (At least in this iteration)
if ( config.isEnabled( 'is_running_in_woo_site' ) ) {
return 'wc-blaze-plugin';
} else if ( config.isEnabled( 'is_running_in_blaze_plugin' ) ) {
return 'wp-blaze-plugin';
} else if ( config.isEnabled( 'is_running_in_jetpack_site' ) ) {
return isAtomic ? 'jetpack-atomic' : 'jetpack';
} else if ( isWpMobileApp() ) {
Expand Down Expand Up @@ -179,6 +182,7 @@ export async function showDSP(
try {
const isRunningInJetpack = config.isEnabled( 'is_running_in_jetpack_site' );
const isRunningInWooBlaze = config.isEnabled( 'is_running_in_woo_site' );
const isRunningInBlazePlugin = config.isEnabled( 'is_running_in_blaze_plugin' );
const isMobileApp = isWpMobileApp() || isWcMobileApp();

window.BlazePress.render( {
Expand Down Expand Up @@ -208,6 +212,7 @@ export async function showDSP(
uploadImageLabel: isMobileApp ? __( 'Tap to add image' ) : undefined,
showGetStartedMessage: ! isMobileApp, // Don't show the GetStartedMessage in the mobile app.
source: source,
isRunningInBlazePlugin,
isRunningInWooBlaze,
isRunningInJetpack,
jetpackXhrParams: isRunningInJetpack
Expand Down

0 comments on commit 8f631c4

Please sign in to comment.