Kaynağa Gözat

fix payment display on local networks

pull/73/head
Jonathan Cobb 3 yıl önce
ebeveyn
işleme
b7120e4099
2 değiştirilmiş dosya ile 57 ekleme ve 35 silme
  1. +1
    -1
      src/_components/modals/LaunchBubbleSettingsModal.vue
  2. +56
    -34
      src/_pages/Layout.vue

+ 1
- 1
src/_components/modals/LaunchBubbleSettingsModal.vue Dosyayı Görüntüle

@@ -775,7 +775,7 @@ export default {

plans(p) {
if (p) {
console.log('plans', JSON.stringify(this.user));
// console.log('plans', JSON.stringify(this.user));
if (this.user && this.user.preferredPlan) {
const plans = this.planObjects;
if (plans) {


+ 56
- 34
src/_pages/Layout.vue Dosyayı Görüntüle

@@ -58,6 +58,20 @@ export default {
...mapActions('users', ['getPolicyByUserId']),
...mapActions('paymentMethods', ['getAllAccountPaymentMethods']),

setPageAvailability() {
this.isPageAvailable =
!this.currentUser ||
this.configs.localNetwork ||
this.$route.path === '/login' ||
this.$route.path === '/me/action' ||
this.$route.path === '/logout' ||
this.$route.path === '/verifyEmail' ||
((this.verifiedContacts || this.currentUser.admin) &&
(!this.configs.paymentsEnabled ||
this.hasPaymentMethod === true ||
this.$route.path === '/payment'));
},

initDefaults() {
this.currentUser = util.currentUser();
const selectedLocale =
@@ -77,17 +91,7 @@ export default {
errors: this.errors,
});
}

this.isPageAvailable =
!this.currentUser ||
this.$route.path === '/login' ||
this.$route.path === '/me/action' ||
this.$route.path === '/logout' ||
this.$route.path === '/verifyEmail' ||
((this.verifiedContacts || this.currentUser.admin) &&
(!this.configs.paymentsEnabled ||
this.hasPaymentMethod === true ||
this.$route.path === '/payment'));
this.setPageAvailability();
},

hasVerifiedContact(policy) {
@@ -126,6 +130,13 @@ export default {
this.initDefaults();
}
},

stopVerifyRefresher() {
if (this.verifiedContactRefresher !== null) {
window.clearInterval(this.verifiedContactRefresher);
this.verifiedContactRefresher = null;
}
}
},

watch: {
@@ -139,35 +150,46 @@ export default {
this.verifiedContacts = this.hasVerifiedContact(p);
const currentUser = util.currentUser();
if (!currentUser) return;
if (!this.verifiedContacts && !currentUser.admin && !this.configs.localNetwork) {
this.navigateToVerifyEmail();
if (this.verifiedContactRefresher === null) {
const vue = this;
const currentUser = util.currentUser();
this.verifiedContactRefresher = window.setInterval(() => {
vue.getPolicyByUserId({
if (this.configs.localNetwork) {
this.verifiedContacts = true;
this.stopVerifyRefresher();
this.setPageAvailability();
} else {
if (!this.verifiedContacts && !currentUser.admin) {
this.navigateToVerifyEmail();
if (this.verifiedContactRefresher === null) {
const vue = this;
const currentUser = util.currentUser();
this.verifiedContactRefresher = window.setInterval(() => {
vue.getPolicyByUserId({
userId: currentUser.uuid,
messages: vue.messages,
errors: vue.errors,
});
}, 5000);
}
} else {
if (this.configs.paymentsEnabled && !this.configs.localNetwork) {
const currentUser = util.currentUser();
this.getAllAccountPaymentMethods({
userId: currentUser.uuid,
messages: vue.messages,
errors: vue.errors,
messages: this.messages,
errors: this.errors,
});
}, 5000);
}
} else {
if (this.configs.paymentsEnabled && !this.configs.localNetwork) {
const currentUser = util.currentUser();
this.getAllAccountPaymentMethods({
userId: currentUser.uuid,
messages: this.messages,
errors: this.errors,
});
}
if (this.verifiedContactRefresher !== null) {
window.clearInterval(this.verifiedContactRefresher);
this.verifiedContactRefresher = null;
}
this.stopVerifyRefresher()
}
}
},

configs (cfgs) {
if (cfgs && cfgs.localNetwork) {
this.verifiedContacts = true;
this.stopVerifyRefresher();
this.setPageAvailability();
}
},

accountPaymentMethods(pms, oldpms) {
if (
pms &&


Yükleniyor…
İptal
Kaydet