mirror of
https://github.com/sudoxnym/habitica-self-host.git
synced 2026-08-02 12:09:39 +00:00
Fixed disabling button and dismissing modals (#9805)
This commit is contained in:
parent
c33eba6736
commit
d4f634c3d8
1 changed files with 7 additions and 2 deletions
|
|
@ -7,8 +7,8 @@
|
|||
style="width: 400px; height: 140px;")
|
||||
.modal-footer
|
||||
.text-center
|
||||
.btn.btn-primary(v-if="amazonPaymentsCanCheckout",
|
||||
@click="amazonCheckOut()") {{ $t('checkout') }}
|
||||
button.btn.btn-primary(v-if="amazonPaymentsCanCheckout",
|
||||
@click="amazonCheckOut()", :disabled='!amazonButtonEnabled') {{ $t('checkout') }}
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
|
|
@ -164,6 +164,7 @@ export default {
|
|||
onReady: (consent) => {
|
||||
let getConsent = consent.getConsentStatus;
|
||||
this.$set(this.amazonPayments, 'recurringConsent', getConsent ? Boolean(getConsent()) : false);
|
||||
this.$set(this, 'amazonButtonEnabled', true);
|
||||
},
|
||||
onConsent: (consent) => {
|
||||
this.$set(this.amazonPayments, 'recurringConsent', Boolean(consent.getConsentStatus()));
|
||||
|
|
@ -190,6 +191,7 @@ export default {
|
|||
});
|
||||
|
||||
if (response.status < 400) {
|
||||
this.$set(this, 'amazonButtonEnabled', true);
|
||||
this.reset();
|
||||
// @TODO: What are we syncing?
|
||||
window.location.reload(true);
|
||||
|
|
@ -216,11 +218,14 @@ export default {
|
|||
|
||||
let responseStatus = response.status;
|
||||
if (responseStatus >= 400) {
|
||||
this.$set(this, 'amazonButtonEnabled', true);
|
||||
alert(`Error: ${response.message}`);
|
||||
// @TODO: do we need this? this.amazonPaymentsreset();
|
||||
return;
|
||||
}
|
||||
|
||||
this.$root.$emit('bv::hide::modal', 'amazon-payment');
|
||||
|
||||
let newGroup = response.data.data;
|
||||
if (newGroup && newGroup._id) {
|
||||
// @TODO: Just append? or $emit?
|
||||
|
|
|
|||
Loading…
Reference in a new issue