#835 Fix Disabled Guest Button In Create Customer Component

This commit is contained in:
Sebastian
2020-07-15 16:25:42 +02:00
parent eeeb4a2c94
commit 2399e7bf3b

View File

@@ -132,8 +132,8 @@ export class CreateCustomerCardComponent implements OnInit, OnDestroy {
cartHasItemsForTakeNow = false;
cartHasItemsForDownload = false;
guestChecked = false;
onlineChecked = false;
guestDisabled = true;
onlineChecked = true;
guestDisabled = false;
customerCardChecked = false;
deliveryAndGuestOrOnline = false;
pickUpOrTakeNowAndOnline = false;
@@ -261,24 +261,30 @@ export class CreateCustomerCardComponent implements OnInit, OnDestroy {
this.cartHasItemsForTakeNow = cartHasItemsFor(DeliveryOption.TAKE_NOW);
this.cartHasItemsForDownload = cartHasItemsFor(DeliveryOption.DOWNLOAD);
(this.cartHasItemsForDownload || this.cartHasItemsForDelivery).ifTrue(
() => {
this.onlineChecked = true;
this.guestChecked = false;
this.flagsSetByConditions = true;
this.cartHasItemsForDownload.ifTrue(() => {
this.onlineChecked = true;
this.guestDisabled = true;
this.guestChecked = false;
this.flagsSetByConditions = true;
if (this.cartHasItemsForDownload) {
this.headerText =
'Um Ihnen das ebook bereitstellen zu können, brauchen Sie ein Onlinekonto bei Hugendubel. Wir richten es Ihnen gerne sofort ein.';
}
if (this.cartHasItemsForDownload) {
this.headerText =
'Um Ihnen das ebook bereitstellen zu können, brauchen Sie ein Onlinekonto bei Hugendubel. Wir richten es Ihnen gerne sofort ein.';
}
);
});
if (!this.cartHasItemsForDownload) {
this.guestDisabled = false;
this.flagsSetByConditions = true;
}
(
this.cartHasItemsForDelivery &&
!this.cartHasItemsForDownload &&
!this.onlineChecked
).ifTrue(this.guestCheckboxInitialization);
this.detectChanges();
};
guestCheckboxInitialization = () => {