diff --git a/ghost/admin/app/controllers/explore.js b/ghost/admin/app/controllers/explore.js index d3f90463bf03..92e3e3bd8e37 100644 --- a/ghost/admin/app/controllers/explore.js +++ b/ghost/admin/app/controllers/explore.js @@ -44,8 +44,6 @@ export default class ExploreController extends Controller { // to the submit page and fetch the required site data setTimeout(() => { this.explore.toggleExploreWindow(true); - this.explore.sendRouteUpdate({path: '/explore'}); - this.router.transitionTo('explore'); }, 500); } else { // Ghost Explore URL to submit a new site diff --git a/ghost/admin/app/routes/explore/index.js b/ghost/admin/app/routes/explore/index.js index 5d3d8695ba32..515d7d007f50 100644 --- a/ghost/admin/app/routes/explore/index.js +++ b/ghost/admin/app/routes/explore/index.js @@ -31,7 +31,7 @@ export default class ExploreRoute extends AuthenticatedRoute { } @action - willTransition(transition) { + async willTransition(transition) { let isExploreTransition = false; if (transition) { @@ -43,10 +43,23 @@ export default class ExploreRoute extends AuthenticatedRoute { if (destinationUrl?.includes('/explore')) { isExploreTransition = true; - let path = destinationUrl.replace(/explore\//, ''); - path = path === '/' ? '/explore' : path; - // Send the updated route to the iframe - this.explore.sendRouteUpdate({path}); + this.explore.isIframeTransition = isExploreTransition; + + if (destinationUrl?.includes('/explore/submit')) { + // Ensure the model is loaded before sending the controller action + const model = await this.model; + this.controllerFor('explore').submitExploreSite(model); + } else { + let path = destinationUrl.replace(/explore\//, ''); + path = path === '/' ? '/explore/' : path; + + if (destinationUrl?.includes('/explore/about')) { + window.open(`${this.explore.exploreUrl}about/`, '_blank').focus(); + path = '/explore/'; + } + // Send the updated route to the iframe + this.explore.sendRouteUpdate({path}); + } } }