redirectToDefaultSitePage: function( context, next ) { var siteFragment = route.getSiteFragment( context.path ); if ( siteFragment ) { // if we are redirecting we need to retain our intended layout-focus layoutFocus.setNext( layoutFocus.getCurrent() ); page.redirect( route.getStatsDefaultSitePage( siteFragment ) ); } else { next(); } },
GlobalShortcuts.prototype.goToStats = function() { const site = this.selectedSite; if ( site && site.capabilities && ! site.capabilities.view_stats ) { return null; } else if ( site && site.slug ) { page( getStatsDefaultSitePage( site.slug ) ); } else { page( '/stats' ); } };
redirectToDefaultSitePage: function( context, next ) { const siteFragment = route.getSiteFragment( context.path ); if ( siteFragment ) { // if we are redirecting we need to retain our intended layout-focus const currentLayoutFocus = getCurrentLayoutFocus( context.store.getState() ); context.store.dispatch( setNextLayoutFocus( currentLayoutFocus ) ); page.redirect( route.getStatsDefaultSitePage( siteFragment ) ); } else { next(); } },