From 65dc55afd20c62764d1cfd2fc6038c19c2cf8d35 Mon Sep 17 00:00:00 2001 From: Andres Blanco Date: Thu, 21 Jul 2022 11:55:59 -0300 Subject: [PATCH 1/2] fix default behaviour on AT --- client/state/themes/actions/activate.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/client/state/themes/actions/activate.js b/client/state/themes/actions/activate.js index c4df2c90608c3..31024d01ecc80 100644 --- a/client/state/themes/actions/activate.js +++ b/client/state/themes/actions/activate.js @@ -54,6 +54,8 @@ export function activate( ); } + keepCurrentHomepage = isSiteAtomic( getState(), siteId ) ? true : keepCurrentHomepage; + return dispatch( activateTheme( themeId, siteId, source, purchased, keepCurrentHomepage ) ); }; } From bbcde16575a53b7d893e89a2ea58a485b6319246 Mon Sep 17 00:00:00 2001 From: Andres Blanco Date: Fri, 22 Jul 2022 11:36:20 -0300 Subject: [PATCH 2/2] move default value before conditional --- client/state/themes/actions/activate.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/state/themes/actions/activate.js b/client/state/themes/actions/activate.js index 31024d01ecc80..5ea59f8397c5c 100644 --- a/client/state/themes/actions/activate.js +++ b/client/state/themes/actions/activate.js @@ -45,6 +45,8 @@ export function activate( return dispatch( showAutoLoadingHomepageWarning( themeId ) ); } + keepCurrentHomepage = isSiteAtomic( getState(), siteId ) ? true : keepCurrentHomepage; + if ( isJetpackSite( getState(), siteId ) && ! getTheme( getState(), siteId, themeId ) ) { const installId = suffixThemeIdForInstall( getState(), siteId, themeId ); // If theme is already installed, installation will silently fail, @@ -54,8 +56,6 @@ export function activate( ); } - keepCurrentHomepage = isSiteAtomic( getState(), siteId ) ? true : keepCurrentHomepage; - return dispatch( activateTheme( themeId, siteId, source, purchased, keepCurrentHomepage ) ); }; }