mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 14:47:53 +01:00
Remove cancel button when clicked (#9616)
This commit is contained in:
@@ -68,7 +68,7 @@
|
|||||||
|
|
||||||
div(v-if='hasSubscription')
|
div(v-if='hasSubscription')
|
||||||
.btn.btn-primary(v-if='canEditCardDetails', @click='showStripeEdit()') {{ $t('subUpdateCard') }}
|
.btn.btn-primary(v-if='canEditCardDetails', @click='showStripeEdit()') {{ $t('subUpdateCard') }}
|
||||||
.btn.btn-sm.btn-danger(v-if='canCancelSubscription', @click='cancelSubscription()') {{ $t('cancelSub') }}
|
.btn.btn-sm.btn-danger(v-if='canCancelSubscription && !loading', @click='cancelSubscription()') {{ $t('cancelSub') }}
|
||||||
small(v-if='!canCancelSubscription', v-html='getCancelSubInfo()')
|
small(v-if='!canCancelSubscription', v-html='getCancelSubInfo()')
|
||||||
|
|
||||||
.subscribe-pay(v-if='!hasSubscription || hasCanceledSubscription')
|
.subscribe-pay(v-if='!hasSubscription || hasCanceledSubscription')
|
||||||
@@ -118,6 +118,7 @@ export default {
|
|||||||
mixins: [paymentsMixin],
|
mixins: [paymentsMixin],
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
|
loading: false,
|
||||||
gemCostTranslation: {
|
gemCostTranslation: {
|
||||||
gemCost: planGemLimits.convRate,
|
gemCost: planGemLimits.convRate,
|
||||||
gemLimit: planGemLimits.convRate,
|
gemLimit: planGemLimits.convRate,
|
||||||
|
|||||||
@@ -175,6 +175,8 @@ export default {
|
|||||||
if (config && config.group && !confirm(this.$t('confirmCancelGroupPlan'))) return;
|
if (config && config.group && !confirm(this.$t('confirmCancelGroupPlan'))) return;
|
||||||
if (!confirm(this.$t('sureCancelSub'))) return;
|
if (!confirm(this.$t('sureCancelSub'))) return;
|
||||||
|
|
||||||
|
this.loading = true;
|
||||||
|
|
||||||
let group;
|
let group;
|
||||||
if (config && config.group) {
|
if (config && config.group) {
|
||||||
group = config.group;
|
group = config.group;
|
||||||
@@ -203,6 +205,9 @@ export default {
|
|||||||
|
|
||||||
let cancelUrl = `/${paymentMethod}/subscribe/cancel?${encodeParams(queryParams)}`;
|
let cancelUrl = `/${paymentMethod}/subscribe/cancel?${encodeParams(queryParams)}`;
|
||||||
await axios.get(cancelUrl);
|
await axios.get(cancelUrl);
|
||||||
|
|
||||||
|
this.loading = false;
|
||||||
|
|
||||||
// Success
|
// Success
|
||||||
alert(this.$t('paypalCanceled'));
|
alert(this.$t('paypalCanceled'));
|
||||||
this.$router.push('/');
|
this.$router.push('/');
|
||||||
|
|||||||
Reference in New Issue
Block a user