Skip to content

Commit

Permalink
Fix the loading state between installation and activation
Browse files Browse the repository at this point in the history
  • Loading branch information
arthur791004 committed Oct 1, 2024
1 parent a039baa commit 02cc08a
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions client/state/themes/actions/install-theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,6 @@ export function installTheme( themeId, siteId ) {
.post( `/sites/${ siteId }/themes/${ themeId }/install` )
.then( ( theme ) => {
dispatch( receiveTheme( theme, siteId ) );
dispatch( {
type: THEME_INSTALL_SUCCESS,
siteId,
themeId,
} );

// Install parent theme if theme requires one
if ( themeId.endsWith( '-wpcom' ) ) {
Expand All @@ -48,6 +43,13 @@ export function installTheme( themeId, siteId ) {
}
} )
.then( () => dispatch( requestThemes( siteId, {} ) ) )
.then( () => {
dispatch( {
type: THEME_INSTALL_SUCCESS,
siteId,
themeId,
} );
} )
.catch( ( error ) => {
dispatch( {
type: THEME_INSTALL_FAILURE,
Expand Down

0 comments on commit 02cc08a

Please sign in to comment.