From a039baa1be40d6cc3627291c3765103f49dffb05 Mon Sep 17 00:00:00 2001 From: arthur Date: Tue, 1 Oct 2024 13:26:48 +0800 Subject: [PATCH] Theme: Remove Congrats screen for the DotOrg theme --- client/my-sites/theme/main.jsx | 12 ++++++++---- client/state/themes/actions/activate.js | 7 +------ 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/client/my-sites/theme/main.jsx b/client/my-sites/theme/main.jsx index fea46221cb089..5f0a7a3ec4df3 100644 --- a/client/my-sites/theme/main.jsx +++ b/client/my-sites/theme/main.jsx @@ -59,7 +59,6 @@ import { connectOptions } from 'calypso/my-sites/themes/theme-options'; import ThemePreview from 'calypso/my-sites/themes/theme-preview'; import { recordTracksEvent } from 'calypso/state/analytics/actions'; import { getCurrentUserSiteCount, isUserLoggedIn } from 'calypso/state/current-user/selectors'; -import { productToBeInstalled } from 'calypso/state/marketplace/purchase-flow/actions'; import { successNotice, errorNotice } from 'calypso/state/notices/actions'; import { getProductsList } from 'calypso/state/products-list/selectors'; import { isUserPaid } from 'calypso/state/purchases/selectors'; @@ -103,6 +102,7 @@ import { getThemeType, isThemeWooCommerce, isActivatingTheme as getIsActivatingTheme, + isInstallingTheme as getIsInstallingTheme, } from 'calypso/state/themes/selectors'; import { getIsLoadingCart } from 'calypso/state/themes/selectors/get-is-loading-cart'; import { getBackPath } from 'calypso/state/themes/themes-ui/selectors'; @@ -353,9 +353,13 @@ class ThemeSheet extends Component { }; isRequestingActivatingTheme = () => { - const { isThemeActivationSyncStarted, isActivatingTheme } = this.props; + const { isThemeActivationSyncStarted, isActivatingTheme, isInstallingTheme } = this.props; const { isAtomicTransferCompleted } = this.state; - return ( isThemeActivationSyncStarted && ! isAtomicTransferCompleted ) || isActivatingTheme; + return ( + ( isThemeActivationSyncStarted && ! isAtomicTransferCompleted ) || + isActivatingTheme || + isInstallingTheme + ); }; // If a theme has been removed by a theme shop, then the theme will still exist and a8c will take over any support responsibilities. @@ -1666,6 +1670,7 @@ export default connect( isLivePreviewSupported, themeType: getThemeType( state, themeId ), isActivatingTheme: getIsActivatingTheme( state, siteId ), + isInstallingTheme: getIsInstallingTheme( state, themeId, siteId ), }; }, { @@ -1674,6 +1679,5 @@ export default connect( recordTracksEvent, themeStartActivationSync: themeStartActivationSyncAction, errorNotice, - setProductToBeInstalled: productToBeInstalled, } )( withSiteGlobalStylesStatus( localize( ThemeSheetWithOptions ) ) ); diff --git a/client/state/themes/actions/activate.js b/client/state/themes/actions/activate.js index 44e311c4c979f..ed08e5e326f16 100644 --- a/client/state/themes/actions/activate.js +++ b/client/state/themes/actions/activate.js @@ -1,5 +1,4 @@ import page from '@automattic/calypso-router'; -import { productToBeInstalled } from 'calypso/state/marketplace/purchase-flow/actions'; import isSiteAtomic from 'calypso/state/selectors/is-site-wpcom-atomic'; import { isJetpackSite, getSiteSlug } from 'calypso/state/sites/selectors'; import { activateTheme } from 'calypso/state/themes/actions/activate-theme'; @@ -38,6 +37,7 @@ export function activate( themeId, siteId, options ) { // The theme with the plugin bundle will be handled by the plugin bundle flow. const shouldAtomicTransfer = isExternallyManagedTheme( getState(), themeId ) || + isDotOrgTheme || ( isDotComTheme && hasThemeBundleSoftwareSet && ! isOnboardingFlow ); /** @@ -75,11 +75,6 @@ export function activate( themeId, siteId, options ) { ); } - if ( isDotOrgTheme ) { - dispatch( productToBeInstalled( themeId, siteSlug ) ); - return page( `/marketplace/theme/${ themeId }/install/${ siteSlug }` ); - } - return activateOrInstallThenActivate( themeId, siteId, { source, purchased,