Skip to content

Commit

Permalink
Theme: Remove Congrats screen for the DotOrg theme
Browse files Browse the repository at this point in the history
  • Loading branch information
arthur791004 committed Oct 1, 2024
1 parent 5f631d0 commit a039baa
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
12 changes: 8 additions & 4 deletions client/my-sites/theme/main.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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';
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -1666,6 +1670,7 @@ export default connect(
isLivePreviewSupported,
themeType: getThemeType( state, themeId ),
isActivatingTheme: getIsActivatingTheme( state, siteId ),
isInstallingTheme: getIsInstallingTheme( state, themeId, siteId ),
};
},
{
Expand All @@ -1674,6 +1679,5 @@ export default connect(
recordTracksEvent,
themeStartActivationSync: themeStartActivationSyncAction,
errorNotice,
setProductToBeInstalled: productToBeInstalled,
}
)( withSiteGlobalStylesStatus( localize( ThemeSheetWithOptions ) ) );
7 changes: 1 addition & 6 deletions client/state/themes/actions/activate.js
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -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 );

/**
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit a039baa

Please sign in to comment.