Skip to content

Commit

Permalink
Add behaviour in theme intro screen to go back using history (#83914)
Browse files Browse the repository at this point in the history
  • Loading branch information
ilyasfoo authored Nov 7, 2023
1 parent e9547e5 commit 240ae34
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions client/my-sites/theme/main.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -1003,6 +1003,14 @@ class ThemeSheet extends Component {
goBack = () => {
const { backPath, locale, isLoggedIn, themeId } = this.props;
this.props.recordTracksEvent( 'calypso_theme_sheet_back_click', { theme_name: themeId } );

// Use history back when coming from customize your store screen.
const urlParams = new URLSearchParams( window.location.search );
if ( urlParams.has( 'from', 'customize-store' ) && window.history.length > 1 ) {
window.history.back();
return;
}

page( localizeThemesPath( backPath, locale, ! isLoggedIn ) );
};

Expand Down

0 comments on commit 240ae34

Please sign in to comment.