diff --git a/web/satellite/src/components/team/HeaderArea.vue b/web/satellite/src/components/team/HeaderArea.vue index ffe188b69..14535014a 100644 --- a/web/satellite/src/components/team/HeaderArea.vue +++ b/web/satellite/src/components/team/HeaderArea.vue @@ -206,7 +206,7 @@ export default class HeaderArea extends Vue { const projects = await this.$store.dispatch(PROJECTS_ACTIONS.FETCH); if (!projects.length) { await this.$store.dispatch(APP_STATE_ACTIONS.CHANGE_STATE, AppState.LOADED_EMPTY); - await this.$router.push(RouteConfig.ProjectDashboard.path); + await this.$router.push(RouteConfig.Account.with(RouteConfig.Billing).path); return; } diff --git a/web/satellite/src/store/modules/payments.ts b/web/satellite/src/store/modules/payments.ts index 31f6225ef..49f6bd3c5 100644 --- a/web/satellite/src/store/modules/payments.ts +++ b/web/satellite/src/store/modules/payments.ts @@ -262,10 +262,10 @@ export function makePaymentsModule(api: PaymentsApi): StoreModule }, getters: { canUserCreateFirstProject: (state: PaymentsState): boolean => { - return state.billingHistory.some((billingItem: BillingHistoryItem) => { + return (state.billingHistory.some((billingItem: BillingHistoryItem) => { return billingItem.amount >= 50 && billingItem.type === BillingHistoryItemType.Transaction && billingItem.status === BillingHistoryItemStatus.Completed; - }) || state.creditCards.length > 0; + }) && state.balance > 0) || state.creditCards.length > 0; }, isInvoiceForPreviousRollup: (state: PaymentsState): boolean => { const now = new Date(); diff --git a/web/satellite/tests/unit/components/header/NewProjectArea.spec.ts b/web/satellite/tests/unit/components/header/NewProjectArea.spec.ts index 8dc506e59..6722ceddb 100644 --- a/web/satellite/tests/unit/components/header/NewProjectArea.spec.ts +++ b/web/satellite/tests/unit/components/header/NewProjectArea.spec.ts @@ -76,6 +76,7 @@ describe('NewProjectArea', () => { BillingHistoryItemStatus.Completed, 'test', new Date(), new Date(), BillingHistoryItemType.Transaction); store.commit(PAYMENTS_MUTATIONS.CLEAR); store.commit(PAYMENTS_MUTATIONS.SET_BILLING_HISTORY, [billingTransactionItem]); + store.commit(PAYMENTS_MUTATIONS.SET_BALANCE, 50); const wrapper = mount(NewProjectArea, { store,