fixes part 6

This commit is contained in:
Čarodej
2022-03-03 07:37:28 +01:00
parent 4b751a29c2
commit 6ca2269c80
6 changed files with 29 additions and 16 deletions

View File

@@ -10,7 +10,7 @@
'border-3 border-white dark:border-dark-background': isBorder, 'border-3 border-white dark:border-dark-background': isBorder,
}, },
]" ]"
class="object-cover" class="object-cover mx-auto"
/> />
<div <div
v-else v-else

View File

@@ -5,12 +5,12 @@
> >
<!--Navigation--> <!--Navigation-->
<div v-if="user" class="mb-auto text-center"> <div v-if="user" class="mb-auto text-center">
<MemberAvatar class="mx-auto inline-block" :size="44" :is-border="false" :member="user" /> <MemberAvatar class="mx-auto" :size="44" :is-border="false" :member="user" />
<!--Usage--> <!--Usage-->
<div <div
v-if="config.subscriptionType === 'metered' && user.data.meta.usages" v-if="config.subscriptionType === 'metered' && user.data.meta.usages"
class="mt-1 text-center leading-3" class="mt-2.5 text-center leading-3"
> >
<b class="text-theme block text-xs font-bold leading-3"> <b class="text-theme block text-xs font-bold leading-3">
{{ user.data.meta.usages.costEstimate }} {{ user.data.meta.usages.costEstimate }}

View File

@@ -114,9 +114,8 @@
v-for="(plan, i) in plans.data" v-for="(plan, i) in plans.data"
:plan="plan" :plan="plan"
:key="plan.data.id" :key="plan.data.id"
v-if=" v-if="plan.data.attributes.interval === intervalPlanType"
plan.data.attributes.interval === intervalPlanType && userSubscribedPlanId !== plan.data.id :class="{'opacity-50 pointer-events-none': userSubscribedPlanId === plan.data.id}"
"
:is-selected="selectedPlan && selectedPlan.data.id === plan.data.id" :is-selected="selectedPlan && selectedPlan.data.id === plan.data.id"
@click.native="selectPlan(plan)" @click.native="selectPlan(plan)"
/> />
@@ -281,6 +280,9 @@ export default {
type: 'success', type: 'success',
message: this.$t('Your payment was successfully received.'), message: this.$t('Your payment was successfully received.'),
}) })
// todo: temporary reload function
setTimeout(() => document.location.reload(), 1000)
}, },
paystackClosed() { paystackClosed() {
// ... // ...

View File

@@ -90,9 +90,7 @@ export default {
.post('/api/subscriptions/cancel') .post('/api/subscriptions/cancel')
.then(() => { .then(() => {
// Update user data // Update user data
this.$store.dispatch('getAppData').then(() => { this.$store.dispatch('getAppData')
this.fetchSubscriptionDetail()
})
events.$emit('toaster', { events.$emit('toaster', {
type: 'success', type: 'success',

View File

@@ -37,13 +37,26 @@ const actions = {
}) })
}, 300) }, 300)
axios.post('/logout').then(() => { axios
clearTimeout(popup) .post('/logout')
commit('DESTROY_DATA') .then(() => {
commit('SET_AUTHORIZED', false) clearTimeout(popup)
router.push({ name: 'Homepage' }) commit('DESTROY_DATA')
}) commit('SET_AUTHORIZED', false)
router.push({name: 'Homepage'})
})
.catch((error) => {
if (error.response.status === 419) {
clearTimeout(popup)
commit('DESTROY_DATA')
commit('SET_AUTHORIZED', false)
router.push({name: 'Homepage'})
}
})
}, },
socialiteRedirect: ({ commit }, provider) => { socialiteRedirect: ({ commit }, provider) => {
axios axios

View File

@@ -650,7 +650,7 @@ export default {
}) })
}, },
getWebhookEndpoint(service) { getWebhookEndpoint(service) {
return `${this.config.host}/api/subscriptions/${service}/webhook` return `${this.config.host}/api/subscriptions/${service}/webhooks`
}, },
}, },
created() { created() {