Reverted "Added home redirect for pricing wizard"

This reverts commit 0cf2fc9c24.

Hiding the launch wizard when there are existing prices causes an annoying flicker on the dashboard everytime we reload the page or navigate away. Instead of handling this client side, we'll push up the logic to hide the wizard on server.
This commit is contained in:
Rishabh 2021-05-07 16:14:07 +05:30
parent fa454a8e47
commit e066fb5345
4 changed files with 2 additions and 26 deletions

View File

@ -183,6 +183,7 @@ export default class GhLaunchWizardSetPricingComponent extends Component {
...data,
product: null
});
this.args.nextStep();
}
}

View File

@ -2,7 +2,6 @@ import Controller from '@ember/controller';
import {action} from '@ember/object';
import {getSymbol} from 'ghost-admin/utils/currency';
import {inject as service} from '@ember/service';
import {task} from 'ember-concurrency-decorators';
import {tracked} from '@glimmer/tracking';
export default class DashboardController extends Controller {
@ -36,7 +35,6 @@ export default class DashboardController extends Controller {
@tracked whatsNewEntries = null;
@tracked whatsNewEntriesLoading = null;
@tracked whatsNewEntriesError = null;
@tracked product = null;
get topMembersDataHasOpenRates() {
return this.topMembersData && this.topMembersData.find((member) => {
@ -49,28 +47,12 @@ export default class DashboardController extends Controller {
}
initialise() {
this.loadProducts.perform();
this.loadEvents();
this.loadTopMembers();
this.loadCharts();
this.loadWhatsNew();
}
get showLaunchWizard() {
const hasPrices = this.product && this.product.get('stripePrices').length > 0;
return !this.feature.launchComplete && !hasPrices;
}
@task({drop: true})
*loadProducts() {
try {
const products = yield this.store.query('product', {include: 'stripe_prices'});
this.product = products.firstObject;
} catch (e) {
this.product = null;
}
}
loadMRRStats() {
this.mrrStatsLoading = true;
this.membersStats.fetchMRR().then((stats) => {

View File

@ -6,17 +6,10 @@ export default class LaunchRoute extends AuthenticatedRoute {
beforeModel() {
super.beforeModel(...arguments);
return this.session.user.then((user) => {
if (!user.isOwner) {
return this.transitionTo('home');
}
this.store.query('product', {include: 'stripe_prices'}).then((products) => {
const defaultProduct = products.firstObject;
if (defaultProduct.get('stripePrices').length > 0) {
return this.transitionTo('home');
}
});
});
}
}

View File

@ -7,7 +7,7 @@
<div class="view-container gh-dashboard">
{{#if (and this.session.user.isOwner this.showLaunchWizard)}}
{{#if (and this.session.user.isOwner (not this.feature.launchComplete))}}
<section class="gh-dashboard-area lw-banner">
<div class="gh-lw-banner" style="background-image:url(assets/img/launch-wizard-bg.png);">
<h1>Select your publication style</h1>