use store value and not child component.

This commit is contained in:
Bill Richardson 2024-06-11 12:52:35 -04:00
parent 159698c438
commit ee66831ab9
2 changed files with 5 additions and 8 deletions

View file

@ -193,7 +193,6 @@ export default {
isInitiallyExpanded: Boolean, isInitiallyExpanded: Boolean,
submittedOrder: Object submittedOrder: Object
}, },
emits: ['deductibleTotalUpdated'],
data() { data() {
return { return {
isExpanded: this.isInitiallyExpanded, isExpanded: this.isInitiallyExpanded,
@ -216,9 +215,7 @@ export default {
}, },
computed: { computed: {
deductible() { deductible() {
const newDeductibleTotal = getDeductible(this.cartOrder); return getDeductible(this.cartOrder);
this.$emit('deductibleTotalUpdated', newDeductibleTotal);
return newDeductibleTotal;
}, },
showDeductibleCartItem() { showDeductibleCartItem() {
return this.isUnverified || (!this.isNoComp && !this.isITAC); return this.isUnverified || (!this.isNoComp && !this.isITAC);

View file

@ -32,8 +32,7 @@
:showDropdownHeader="true" :showDropdownHeader="true"
:isInitiallyExpanded="false" :isInitiallyExpanded="false"
recyclingModalCmsWidgetName="RecycleModal" recyclingModalCmsWidgetName="RecycleModal"
servicePackageTitleWidgetName="ServicePackageTitle" servicePackageTitleWidgetName="ServicePackageTitle" />
@deductibleTotalUpdated="updateDeductibleTotal" />
<hr class="mt-0 mb-5" /> <hr class="mt-0 mb-5" />
<alert <alert
v-if="displayPayInAdvanceAlert" v-if="displayPayInAdvanceAlert"
@ -163,7 +162,6 @@ export default {
}, },
data() { data() {
return { return {
deductibleTotal: 0,
paymentMethodInternalModel: this.getPaymentMethodFromStore(), paymentMethodInternalModel: this.getPaymentMethodFromStore(),
rules: { rules: {
optionRequired: globalRules.OPTION_REQUIRED optionRequired: globalRules.OPTION_REQUIRED
@ -189,7 +187,9 @@ export default {
isPayInAdvanceDisabled() { isPayInAdvanceDisabled() {
const piaExperience = this.getSettingValue(experimentSettings.ISS_DISPLAY_PAY_IN_ADVANCE); const piaExperience = this.getSettingValue(experimentSettings.ISS_DISPLAY_PAY_IN_ADVANCE);
const isEnabled = piaExperience === 'true'; const isEnabled = piaExperience === 'true';
const isDeductibleTotalEqualToZero = this.deductibleTotal === 0; const isDeductibleTotalEqualToZero = useMainStore().order.currentDeductible === 0;
console.log(useMainStore().order.currentDeductible);
return !isEnabled || useMainStore().isUnverified || (useMainStore().isDeductible && isDeductibleTotalEqualToZero); return !isEnabled || useMainStore().isUnverified || (useMainStore().isDeductible && isDeductibleTotalEqualToZero);
}, },